[Top][All Lists]
[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: |
Wed, 11 Mar 2009 16:48:01 +0000 |
User-agent: |
KMail/1.9.9 |
> +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
[Qemu-devel] [patch 2/2] qemu: separate thread for io, Marcelo Tosatti, 2009/03/11