WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Prevent flash from running threads in high priority?  (Read 2458 times)

Offline Ulysses_

  • Full Member
  • ***
  • Posts: 232
Prevent flash from running threads in high priority?
« on: November 21, 2010, 12:51:02 PM »
There is this command called "nice" that allows the user to launch a process with a higher or lower than normal priority, so it uses more or less percent of cpu power.  The user can also lower or raise the priority of a process while it is running.

But is it possible for the user or root to raise or lower the priority of a thread that belongs to a process that is running?

The reason I'm asking, the adobe flash plugin for firefox makes the entire user interface of linux unresponsive sometimes when the cpu runs at 100%.  Seen the same thing happen when the priority of a cpu-intensive process is raised too much.  So it is logical to suspect that flash runs some threads in higher than normal priority, and we don't want that.  Jerky video better than a frozen-looking interface.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Prevent flash from running threads in high priority?
« Reply #1 on: November 21, 2010, 04:44:22 PM »
FWIW, such is possible with opera - and actually operapluginwrapper which is a seperate process in prior versions used to run at lowest priority by default.

You could always try to experiment with renicing the firefox PID and see what happens(personally I haven't used ff since quite some time and have no imminent intention to do so).

Hint: You might possibly find htop.tcz coming in handy for monitoring and manipulating nice values.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Ulysses_

  • Full Member
  • ***
  • Posts: 232
Re: Prevent flash from running threads in high priority?
« Reply #2 on: November 22, 2010, 01:34:10 PM »
What's putting you off from using firefox?

Btw, for us who are happy with firefox (myself because of the NoScript, Adblock, BetterPrivacy and DownloadHelper addons):

The title of this topic may be based on a false premise: is there really such a thing as a thread's priority?  The "htop" tool only deals with process priorities.  Where are thread-specific priorities?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Prevent flash from running threads in high priority?
« Reply #3 on: November 22, 2010, 04:33:51 PM »
What's putting you off from using firefox?

That list would certainly be way too long to fit within the scope of this thread...   :P
But one of the reasons is indeed the handling and behaviour wrt plugins in general and flash in particular.

Quote
Btw, for us who are happy with firefox (myself because of the NoScript, Adblock, BetterPrivacy and DownloadHelper addons):

The title of this topic may be based on a false premise: is there really such a thing as a thread's priority?  The "htop" tool only deals with process priorities.  Where are thread-specific priorities?

I had thought they were there by default, perhaps then is a matter of configuration.

To highlight the difference between processes and threads in htop:
press F2 -> select "Display options" -> enable "Display threads in a different color"
 
To toggle tree view press F5

Note: While the process numbers are shown, htop is only able to get the memory usage for all of the threads combined, and each process shows the total memory usage for all of the threads.
« Last Edit: November 22, 2010, 04:43:47 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Prevent flash from running threads in high priority?
« Reply #4 on: November 25, 2010, 09:42:24 PM »
If you don't want to deal with priorities but more directly with "cpu power," something like cpulimit might be of interest.  I think it's process based.