Hi

> Kosaki, I have tried using setpriority on linux to get the OS to handle p=
riorities, but it failed
> in the same way that pthread_setschedparam did; the test script would nev=
er finish and
> wouldn't even respond to ^C. I have no idea why this is failing so badly.=
 (Maybe a bug in
> linux?? More likely a bug in my understanding.)

Which test case do you use?  I'll investigate the issue.


> In any case, another problem with this approach is that you won't readily=
 be able to set
> a thread to higher priority than the main thread. Altho there may be ways=
 around this,
> they come with their own issues. For instance, if a ruby process is start=
ed at the lowest
> possible priority (highest nice level) it won't be =A0possible to have th=
reads within that
> process be a different priority at all. On reflection, it seems better fo=
r ruby to manage its
> own thread priority queue (at least on linux) and have a guaranteed level=
 of support for
> priorities and fixed number of available priorities.

JVM have the same limitation. Then, I guess JRuby too.

http://java.sun.com/j2se/1.5.0/docs/guide/vm/thread-priorities.html#150

So, I think we can accept the limitation too.