Re: JavaMemoryModel: Some C# thread code

From: Doug Lea (dl@cs.oswego.edu)
Date: Mon Jul 31 2000 - 07:35:54 EDT


> > Still leaves a lot of questions open. For example, does the WaitOne
> > call to a ManualResetEvent release locks? If so, which locks?
>
> Events are self-contained synchronization objects that are not explicitly
> associated with external "locks"

Similar issues arise with event frameworks in Java. They can at the
moment only be answered by looking at source code because synch
properties are not documented. For example, AWT/Swing events rely on
java.awt.EventQueue. The methods appear to be synchronized in a way
that eliminates any JMM-related problems, but the only way to check is
to look at the code. As some of us have been saying for a long time,
concurrency properties of key JDK classes such as EventQueue
desperately need better documentation.

Similar issues also arise with the upcoming 1.4 java.nio package that
is planned to include, among other things, a Selector/Selectable
framework that can be used not only for polling-based designs, but
also for analogs of MS constructs that apparently rely on Win32
WaitForMultipleObjects. (Sorry, details aren't yet available because
they are still being argued out in the java.nio JSR group!)

-- 
Doug Lea, Computer Science Department, SUNY Oswego, Oswego, NY 13126 USA
dl@cs.oswego.edu 315-341-2688 FAX:315-341-5424 http://gee.cs.oswego.edu/  
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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