Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Sep 2007 12:56:49 -0700
From:      "Kip Macy" <kip.macy@gmail.com>
To:        "Daniel Eischen" <deischen@freebsd.org>
Cc:        java@freebsd.org, Kris Kennaway <kris@freebsd.org>, freebsd-java@freebsd.org, performance@freebsd.org, Kurt Miller <kurt@intricatesoftware.com>
Subject:   Re: Massive performance loss from OS::sleep hack
Message-ID:  <b1fa29170709161256n25bdb7d8q8aa2f1b263c18e48@mail.gmail.com>
In-Reply-To: <Pine.GSO.4.64.0709161128520.5797@sea.ntplx.net>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/16/07, Daniel Eischen <deischen@freebsd.org> wrote:
> On Sat, 15 Sep 2007, Kip Macy wrote:
>
> > Or more likely they'll continue to maintain a sched_yield that isn't
> > posix compliant. We may just want to add some sort of interface so the
> > jvm can tell the kernel that sched_yield should be non-compliant for
> > the current process.
>
> I don't think that is a good idea, it seems like too much of a hack.
> The scheduler(s) should schedule threads the way they are designed
> to, either obeying a threads priority, using it as a hint, or totally
> ignoring it.
>
> If the JVM kept track of the thread priorities in use, I suppose
> Thread.yield() could first lower the current thread's priority to
> the next used priority and then yield, raising the priority back after
> the yield.  This isn't peIrfect, there are race conditions, the next
> highest priority  thread(s) could be blocked and not runnable, etc.
> Maybe just lowering the priority to min or default priority would work
> well enough.

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.

> This test would fail even on Solaris if you use SCHED_RR or SCHED_FIFO
> since it is POSIX compliant for those scheduling classes.

I honestly don't think it matters. The JCK using it implies that there
are probably java apps that rely on this defective behavior. I would
be willing to bet that Solaris and Java developers at Sun already had
this argument and the Java developers won :-(.

   -Kip



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b1fa29170709161256n25bdb7d8q8aa2f1b263c18e48>