I patched the threadCmd.c (of thread 2.5.2 package) so
you can change the thread priority in windows
environments.
Everything that is modified is enclosed in an #ifdef
_USE_THREADPRIO/endif compiler statement.
I don't know wether unix supports thread priorities.
Thread priorities are
"normal", "above", "below", "high", "low", "idle", "unknown"
where unknown indicates an error.
***
thread::configure ThreadId -priority
returns one of the above names. If none of them does
fit (should not happen) the int value is returned.
If the thread doesn't have priority an empty string is
returned.
***
thread::configure ThreadId -priority NewThreadPriority
changes the thread priority
Note: at the moment no error is returned on a failure
***
maybe someone decides to integrate this in standard
thread library.
Have fun with it!
Harald
patch for thread:configure -priority
Logged In: YES
user_id=95086
This is nice. Thanks for the input. I will review this
and put it in the standard thread extension.
No, Unix does not have an equivalent of this so I assume
that we'd always return empty string on priority inquiry.
The only question is: what to do for priority setting?
Throw error? Eat every string silently?
The other possibility is to say that all Unix threads are priority 0, and that that's both minimum and maximum.