Massive performance loss from OS::sleep hack

Daniel Eischen deischen at freebsd.org
Tue Sep 18 11:01:04 PDT 2007


On Tue, 18 Sep 2007, Kurt Miller wrote:

> Daniel Eischen wrote:
>>
>> I would just totally ignore setting thread priorities
>> unless the UseThreadPriority knob is set.  The kernel
>> scheduler (for libthr) doesn't seem to care what a thread's
>> priority is anyways unless it is in the real-time class.
>> That way, all threads will be at the default priority
>> by default ;-)
>
> I think that's a fine idea. Just changing the default to
> be UseThreadPriority=false and completely remove the
> os_sleep() bits. If Sun corrects the API or the TCK tests
> the default can be changed back.

Yes, and the Java spec (at least for Thread.yield()) is also
saying that priorities are meaningless.  They can't just
say that Thread.yield() allows other threads to run without
defining their behavior.  How many threads can run?  All?
Is it acceptable for yield to allow only one thread to run,
and for only one clock tick?  What is the point of having
priorities in Java if they can't be used reliably?  But I
digress...

-- 
DE


More information about the freebsd-java mailing list