in reply to Re: Looping without introducing a block
in thread Looping without introducing a block
I certainly considered using a single guard variable. The problem is that the routine will not know in advance which things will be locked. Further, I wish other threads to be able to work on those things that are not locked (so I don't want to lock the hash itself). The list of which things to lock will change at each call.
It is ok, I think, for the signal loop to be interrupted, as other threads will be cond_wait()'ing on one or more things that they wish to work on.
And yes, I realize that I will need to be extra careful to avoid deadlocks. I am familiar with this from fork/flock. :P
-Colin.
WHITEPAGES.COM | INC
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Looping without introducing a block
by BrowserUk (Patriarch) on Aug 03, 2005 at 17:27 UTC |