Re: JavaMemoryModel: Reconsidering spurious wakeups

From: Sylvia Else (
Date: Wed Nov 26 2003 - 17:45:03 EST

At 08:50 PM 25/11/2003, Martin Trotter wrote:

>The problem in general is not that JVMs generate these spurious wakeups but
>that they don't attempt to isolate the Java code from spurious wakeups
>generated by the OS. In essence what's being proposed is a new layer of
>function on top of the OS facilities (eg pthread_cond_wait) which detect
>and correct the spurious wakeup case. In general this is going to cost
>performance and include some tricky design issues. I will continue to
>check with other folks but my feeling is that we should allow spurious

I would urge JVM developers to consider the costs v benefits equation here.
While it is true that adding such a layer almost certainly has some impact
on performance, I would doubt that the cost can be large. The performance
lost will be regained (in a matter of days?) by the operation of Moore's law.

On the benefit side, the less dependent that a JVM is on the correct
functioning of the OS, particularly in the context of interrupt/notify
races, the less vulnerable the JVM (and its users!) are to mistakes on the
OS that already exist, but haven't been diagnosed, or which will be added
in the future.

It might seem that OS threading implementations are stable, and that there
is no reason why they should be modified. However we have one company
pressing its interests in respect of Linux multiprocessor code, and the
Linux community's response may well simply be to reimplement it. There is
another OS manufacturer that has shown its willingness to compromise the
integrity of its code base for no technically valid reason, just to get a
marketing advantage. It also has a penchant for adding undocumented
features to give its own products an edge. If the results were that JVMs
became less reliable on that platform, this might well be seen as a plus.

In addition, the Itanium processor has a weaker memory model than current
Pentium processors do, and that might also impact on the correctness of
some threading implementations.

As a developer working in the commercial world, I would always value
reliability over performance.


JavaMemoryModel mailing list -

This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:54 EDT