From: kjana@...4lab.to (YANAGAWA Kazuhisa) Date: 2002-09-23T00:30:11+09:00 Subject: Re: Avoiding busy waiting In message <200209221747.22910.harryo@zip.com.au> harryo@zip.com.au writes: > I note that the documentation in PR says that > ConditionVariable.signal() wakes up the first thread in line waiting > for the lock. Does that mean that if noone is waiting, the signal > just gets thrown away? In that case, things may be OK. Yes, ConditionVariable#signal just dequeues a thread waiting on the ConditionVariable and awakes it. See thread.rb. `t.run if t' means that. > Anyway, I guess you get the picture. Is there a clean way to handle this > situation? Maybe there's a library or class I'm not aware of that provides > this kind of blocking queue. And then see thread.rb again. There's Queue and SizedQueue which implements synchronized queue. # Actually I've not used Thread more than toy examples, but I believe # logically it works unless a bug exists. -- kjana@dm4lab.to September 23, 2002 He knows most who speaks least.