Re: Process.exec() problem - more details

Peter Lovell <[email protected]> Sat, 16 Jul 2005 16:42:59 -0400
Newsgroups gmane.comp.java.vm.sablevm.devel
Message-ID <[email protected]>
Hi Etienne,
thanks for these details.

I'm not aware of the specifics of the memory model problem - perhaps  
you have a summary reference I could look at? I must admit that I'm  
not a java expert, although that does seem to be changing slightly.

Unfortunately for us, trying to run on a single processor is a very  
difficult situation. Our customers are running on many systems of  
varying vintage - some old, some new. I'm not sure that processor- 
affinity is available on them all, and I would suspect otherwise.  
It's worth noting that this isn't exactly a single/multiple cpu  
issue, as recent chips with hyperthreading exhibit the problem (P4 +  
SuSE 9.1 for example). Even if you have only one cpu, you can  
experience this problem.

I had thought (for what specific reason I presently forget) that the  
locking mechanisms in wait/notify were built on top of pthreads, and  
so would inherit the SMP support from that.

In the short term, I'm looking for reliability and not necessarily  
for speed/performance. Is there a build variation which would be  
better for this (I have been using the default, which I think is  
inline). Should I work with Chris to try to get even a workaround, on  
the way to the longer-term solution?

Many thanks.....Peter


On Jul 16, 2005, at 4:03 PM, Etienne Gagnon wrote:

> Hi Peter,
>
> Wait/notify problem on multiprocessor...  Why doesn't this surprise  
> me?
>  As you know, the Java memory model was initially broken.  It has been
> fixed in some JSR, which is (I think) implemented in Sun's 1.5 SDK.
> This JSR was not yet final when I wrote SableVM, so I decided at that
> time to simply ignore multi-processor issues, as the official memory
> model, at that time, was broken (there's no use to implement a  
> broken spec).
>
> Chris Pickett has started, at some point, to implement the necessary
> memory barriers to implement the new (and fixed!) Java memory model in
> SableVM, but as far as I know, his implementation is not complete, and
> hasn't been reviewed for soundness.
>
> So, until somebody contributes an implementation of the new memory
> model, I suggest that you force your OS to run SableVM on a single
> processor.  (I think that under Linux there's something called
> "affinity" to do that; I have no idea how to do that under MacOS).
>
> Hoping this helps,
>
> Etienne
>
> Peter Lovell wrote:
>
>> From what I can see, the root cause seems to be a failure in the
>> wait/notify process in and around ProcessThread.run and   
>> Process.waitFor
>> in VMProcess.java
>> ..
>> Just for info, the test cases today are on Mac OS X using dual  
>> cpu.  The
>> problem occurs sometime within about 600 tries.
>>
>
> -- 
> Etienne M. Gagnon, Ph.D.            http://www.info2.uqam.ca/~egagnon/
> SableVM:                                       http://www.sablevm.org/
> SableCC:                                       http://www.sablecc.org/
> _______________________________________________
> SableVM-devel mailing list
> [email protected]
> http://sablevm.org/lists/control/listinfo/sablevm-devel
>