From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paul Brook <paul@codesourcery.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch 1/2] qemu: sem/thread helpers
Date: Tue, 17 Mar 2009 20:43:44 -0300 [thread overview]
Message-ID: <20090317234344.GA14571@amt.cnet> (raw)
In-Reply-To: <200903172307.08253.paul@codesourcery.com>
On Tue, Mar 17, 2009 at 11:07:07PM +0000, Paul Brook wrote:
> 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.
Actually scratch that. Of course mutex_unlock wakes up waiters. Will
send a better patch soon.
next prev parent reply other threads:[~2009-03-17 23:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-11 16:16 [Qemu-devel] [patch 0/2] RFC: separate thread for IO Marcelo Tosatti
2009-03-11 16:16 ` [Qemu-devel] [patch 1/2] qemu: sem/thread helpers Marcelo Tosatti
2009-03-11 16:33 ` [Qemu-devel] " Anthony Liguori
2009-03-11 16:48 ` [Qemu-devel] " Paul Brook
2009-03-11 16:56 ` Anthony Liguori
2009-03-11 16:58 ` Marcelo Tosatti
2009-03-18 18:47 ` Marcelo Tosatti
2009-03-15 14:15 ` Avi Kivity
2009-03-17 17:42 ` Marcelo Tosatti
2009-03-17 23:07 ` Paul Brook
2009-03-17 23:43 ` Marcelo Tosatti [this message]
2009-03-11 16:16 ` [Qemu-devel] [patch 2/2] qemu: separate thread for io Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090317234344.GA14571@amt.cnet \
--to=mtosatti@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).