Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Process.setPriority()

On Mon, Jan 27, 2003 at 09:30:49AM -0800, Chris Songer wrote:
> Hi!
> 
> I think you want both a relative and absolute actually. For the fellow who 
> wants to do something platform specific you let them pass in a raw priority 
> number. You also do what you suggest and have win32 like settings, Low, 
> BelowNormal, Normal, AboveNormal and High. If you just do the latter then 
> you've hosed the fellow who really needs control for some reason.
> 

Actually, I was thinking more like this...

.setPriority( int val );
.setRelativePriority( int delta );


Then you have complete control, but without having to worry about figuring
out what the priority of the caller's process actually might be.

So, to emulate nice you could do...

.setRelativePriority( -1 );

...but to be totally system specific...

.setPriority( 9 );

Just make sure to put a nice warning on the .setPriority() value that it's
meaning is system dependant and that (more) portable code should use relative
priorities. ;)

    chris

-- 
  Chris McKillop <cdm@xxxxxxx>   "The faster I go, the behinder I get."
  Software Engineer, QSSL                   -- Lewis Carroll --
  http://qnx.wox.org/




Back to the top