Date: Sun, 16 Sep 2007 21:47:53 -0400 From: Kurt Miller <kurt@intricatesoftware.com> To: Kip Macy <kip.macy@gmail.com> Cc: Daniel Eischen <deischen@freebsd.org>, Kris Kennaway <kris@freebsd.org>, performance@freebsd.org, freebsd-java@freebsd.org Subject: Re: Massive performance loss from OS::sleep hack Message-ID: <46EDDCC9.90403@intricatesoftware.com> In-Reply-To: <b1fa29170709161256n25bdb7d8q8aa2f1b263c18e48@mail.gmail.com> References: <46EC1B55.4060202@FreeBSD.org> <200709152250.50879.kurt@intricatesoftware.com> <Pine.GSO.4.64.0709160030580.3591@sea.ntplx.net> <b1fa29170709152225x5a57a30fm7efbd6e331cfff28@mail.gmail.com> <Pine.GSO.4.64.0709161128520.5797@sea.ntplx.net> <b1fa29170709161256n25bdb7d8q8aa2f1b263c18e48@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Kip Macy wrote: > Yes, if we could hack the jvm to work around this without calling > sleep that would be better yet. However, making java work well is more > important than keeping the interface clean. One possible alternative is to not honor thread priorities in the jdk by default. In hotspot/src/os/linux/vm/os_linux.cpp I see this comment: // Note: LinuxThreads only honor thread priority for real time threads. // sched_priority is ignored if policy is SCHED_OTHER. This function is // equivalent to a "noop" on current Linux platforms. OSReturn os::set_native_priority(Thread* thread, int newpri) { which leads me to believe linux doesn't honor thread priorities in the jdk. Perhaps someone could verify that on a linux box. If linux and/or windows doesn't actually honor thread priorities I don't see why we need to. IIRC, there weren't any specific JCK tests that validated a higher priority thread actually got more time then a lower one (I could be wrong on that since there was > 30k tests in the jck). So we could default UseThreadPriorities to false and make the os_sleep() call only be used when UseThreadPriorities is true (i.e. the user explicitly sets -XX:+UseThreadPriorities). Can someone check out linux to see if it indeed supports or ignores thread priorities for java programs? -Kurt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46EDDCC9.90403>