qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [patch 1/2] qemu: sem/thread helpers


From: Paul Brook
Subject: Re: [Qemu-devel] [patch 1/2] qemu: sem/thread helpers
Date: Tue, 17 Mar 2009 23:07:07 +0000
User-agent: KMail/1.9.9

On Tuesday 17 March 2009, Marcelo Tosatti wrote:
> On Sun, Mar 15, 2009 at 04:15:52PM +0200, Avi Kivity wrote:
> > Marcelo Tosatti wrote:
> >> +
> >> +struct QemuSem {
> >> +    sem_t sema;
> >> +};
> >
> > Why aren't you using pthread_mutex_t?
>
> Because we want the thread waiting on the lock to be awakened
> once the holder releases it. This does not happen with pthread
> mutexes AFAIK.

Really? I'd be surprised if there's any difference. The whole point of a mutex 
is that it blocks until the other thread releases it.  At best it sounds like 
you're making fairly sketchy assumptions about the host OS scheduler 
heuristics.

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]