>From: Matthew Strayer <[EMAIL PROTECTED]>

>The situation you describe does not cause deadlock because the wait()
>call in thread
>2 releases the synchronized lock.

Ahh - didn't realise that! It's not been in any docs I've read before. Now, 
i've found it buried now in 4 lines of page 184 of Concurrent programming in 
Java.

>The only way I can think of to alleviate this problem is use different
>synchronization primitives.  Unfortunately, Java
>doesn't have them.  And all libraries that simulate these use
>synchronization!

heheheh - hooray for Java :-)

>Now, maybe someone here could hack some byte code
>(does Java have a set-and-test instruction??) and
>produce them... ;-)

Trouble is with a test and set is it atomic? I would imagine why the lack of 
better sync options and test & set options plus say a version of interlocked 
increment is perhaps due to the 'lowest common denominator' basis of java.

Regards
Ned

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Reply via email to