Issue #3176 has been updated by caleb clausen.

File thread-priorities-try3.diff added

Here's an updated version of my patch. I've incorporated changes according to Yusuke's and Tanaka'a comments and taken out the old way of implementing priorities (via the slice field of rb_thread_t; it was breaking my implementation in some cases). 

I tried to make it use pthread_setschedparam on linux. That would seem to be the 'right' way to do what Kosaki was trying to do, since it allows you to set a thread priority from another thread. But it caused problems; the test program never finished, and wouldn't obey my ^C. So I had to back all that code out. I'll keep trying with that idea, since it would be preferable to have the OS handle priorities if at all possible. 

This patch is still to be considered preliminary. I've tested it somewhat more, but I haven't made the tests automated yet. Benchmarks are still pending too.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/3176

----------------------------------------
http://redmine.ruby-lang.org