On Tue, Jul 31, 2001 at 06:31:23PM -0400, Victor J. Orlikowski wrote: > Rather, let's be more clear. > > bool held=false; > > acquire(mutex2); > release(mutex1); > held=false; > release(mutex2); > nap: sleep(); > acquire(mutex2); > if(held) goto nap; > acquire(mutex1); > held=true; > release(mutex2); > > That explain it somewhat better? ;)
Not really, but maybe I'm just being dense. Assuming "mutex1" is the mutex associated with the condition (and therefore has the same scope), what is the scope of "mutex2" and "held"? And more importantly, if you're using sleep(), then aren't you just doing a primitive poll/wait loop, and therefore defeating the whole purpose of event-based scheduling using CVs? -aaron
