apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <aa...@ebuilt.com>
Subject Re: Conditionals...
Date Thu, 02 Aug 2001 07:03:43 GMT
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


Mime
View raw message