qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [Qemu-devel] [patch 1/2] qemu: sem/thread helpers
Date: Wed, 11 Mar 2009 16:48:01 +0000	[thread overview]
Message-ID: <200903111648.02530.paul@codesourcery.com> (raw)
In-Reply-To: <20090311161942.482576079@localhost.localdomain>

> +int qemu_sem_init(QemuSem *sem);
> +int qemu_sem_lock(QemuSem *sem);

Please don't introduce yet annother set of locking routines.

Also, your function names suggest you actually want a mutex, not a semaphore.

> +int qemu_sem_lock(QemuSem *sem)
> +{

This is bogus. You never check the return value.

> +QemuSem qemu_sem;

It's entirely unclear what is actually protected by the semaphore.

What exactly does the IO thread do? AFAICS device MMIO is still run from 
within the CPU thread. Device code is not threadsafe (and probably never will 
be), so you can't run any of the device callbacks in the IO thread either. 
Doesn't seem like there's a lot left for it to do...

Paul

  parent reply	other threads:[~2009-03-11 16:48 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   ` Paul Brook [this message]
2009-03-11 16:56     ` [Qemu-devel] " 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
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=200903111648.02530.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=aliguori@us.ibm.com \
    --cc=mtosatti@redhat.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).