[6364] in java-interest
Re: Threads, Synchronized methods, and Monitors
daemon@ATHENA.MIT.EDU (garya@ICS.COM)
Fri Mar 29 23:34:56 1996
Date: Fri, 29 Mar 1996 13:09:05 -0700
Reply-To: Java Interest <JAVA-INTEREST@JAVASOFT.COM>
From: garya@ICS.COM
To: Multiple recipients of list JAVA-INTEREST
<JAVA-INTEREST@JAVASOFT.COM>
In-Reply-To: <B0000133879@stumpy.adco.com>
>My question deals with what exactly happens durring the call to
>notify(). I am assuming that the thread calling notify() will not be
>yeilding but will be allowed to continue processing as it was
>(obviously with all thread schedueling rules still intact).
The spec makes no guarantees in this regard.
I was working on some code a week or so ago which leads me to believe that
the implementation actually does a yield. It should not cause any problems
in terms of a properly behaving program, since preemptive scheduling could
cause another thread to begin executing right after the notify() anyway.
However, if you are looking for interesting behaviour, you often won't see it
because of the implicit yield (i.e. two threads tend to swap back and forth in a
pretty regular pattern, rather than the more random one you might expect).
Gary Aitken garya@ics.com (business)
garya@dreamchaser.org (personal)
-----
This message has been forwarded via the JAVA-INTEREST
mailing list. In order to unsubscribe from this list, send a message to
listserv@javasoft.com with the command 'signoff JAVA-INTEREST' in
the message body (not in the subject line).