CR 6860309 - solaris timing issue on thread startup

Alan Bateman Alan.Bateman at
Sat Nov 12 11:58:43 UTC 2011

On 11/11/2011 16:56, Gary Adams wrote:
>  CR 6860309 - TEST_BUG: Insufficient sleep time in 
> java/lang/Runtime/exec/
> A timing problem is reported for slow solaris systems for this
> test to start up a process and systematically torture the underlying
> threads processing data from the running process.
> On my fast solaris machine I can not reproduce the error,
> but it is reasonable to assume that on a slower machine there
> could be scheduling issues that could delay the thread startup
> past the designated 100 millisecond delay in the main thread.
> This webrev suggests gating the process destruction until both
> worker threads are alive.
-Xcomp on a slow machine, always fun when testing the untestable.

I agree with David but I don't think there is perfect solution. I would 
suggest using a CountDownLatch or other synchronization so that the main 
thread waits until the Copier thread is just about to do the read. Then 
do a sleep in the main thread before invoking the destroy method. I 
suspect that is the best that you can do as can't be guaranteed that the 
Copier thread is blocked in the underlying read.


More information about the core-libs-dev mailing list