[gclist] Mars Rover info from comp.risks
Hans Boehm
boehm@hoh.mti.sgi.com
Wed, 7 Jan 1998 12:57:16 -0800
On Jan 8, 9:30am, Stuart Yeates wrote:
> Subject: RE: [gclist] Mars Rover info from comp.risks
> > Hans-Juergen Boehm
> > It seems to me that this actually changes the programming model
> > significantly.
> > Condition variable waits in pthreads (or Java or Modula 3 or Mesa)
> > cannot
> > easily specify the thread they are waiting for. In a lot of code
> > that's not
> > known.
> >
> My understanding is that the JVM (runtime system, including scheduler)
> can track the priority of threads waiting on locks and adjust the
> apparent priority of lock holders or the order in which threads get
> removed from the lock queue transparently. The interface to the JVM was
> written, I believe, to support alternative scheduling implementations.
>
> Good scheduling options are not widely available in JVM's, but that
> doesn't mean they're impossible.
>
Just to clarify: locks ("synchronized" in Java) are not the issue. The
problem is pthread_cond_wait() in pthreads or java.lang.Object.wait() in Java.
My impression is the many JVMs actually handle priority inheritance for locks
more or less correctly. (I guess I can say something positive about Java
synchronization primitves after all :-))
Hans
--
Hans-Juergen Boehm
boehm@mti.sgi.com