Re: notify / notifyAll misunderstanding

From: VisionSet (spam_at_ntlworld.com)
Date: 07/13/04


Date: Tue, 13 Jul 2004 18:22:33 GMT


"John C. Bollinger" <jobollin@indiana.edu> wrote in message
news:cd14v0$e6l$1@hood.uits.indiana.edu...

>
> As an aside: isn't the behavior you actually get more what you want than
> the behavior you expect? I.e. if a lock for a particular record is
> released and one or more threads is waiting for that lock, then don't
> you want one of the waiting threads to reliably get the lock?

Yes, I was just using it to understand the notifyAll(), which I now do
thankyou.

--
Mike W


Relevant Pages

  • notify / notifyAll misunderstanding
    ... notify wakes up a waiting thread that then attempts to ... waiting threads and ONLY ONE gains the lock, the others go back to waiting. ... When unlockis called a record is removed from the set and notifyAll() is ... So 8 waiting threads are then all notified and 1 arbitraily gets the lock. ...
    (comp.lang.java.programmer)
  • Re: notify / notifyAll misunderstanding
    ... > Mike wrote ... >> I have a record locking system that I have condensed to the simple ... The 1st 5 thread will lock because 5 is not locked. ... But when that is unlocked notifyAll will wake all threads but ONLY ONE will ...
    (comp.lang.java.programmer)
  • Re: the wait() and pulse() of monitor
    ... >> Regain lock ... the producer would just pulse multiple times. ... > Sends a signal to one or more waiting threads. ...
    (microsoft.public.dotnet.framework)
  • Re: .net 2.0 : looking for a "best practice" for multi threading jobs
    ... all threads are "blocked" in the GetNectAction() method ... You don't usually need one lock per variable. ... you pulse all the waiting threads before setting the ...
    (microsoft.public.dotnet.framework)
  • Re: the wait() and pulse() of monitor
    ... the producer doesn't use wait itself at all. ... > Wait (exits lock) ... Sends a signal to one or more waiting threads. ...
    (microsoft.public.dotnet.framework)