qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] block: Removed coroutine ownership assumption


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC] block: Removed coroutine ownership assumption
Date: Wed, 27 Jun 2012 10:14:42 +0100

On 27 June 2012 10:10, Andreas Färber <address@hidden> wrote:
> Maybe I'm misunderstanding the discussion, but there's three coroutine
> implementations, including one based on GThread. So in that case any
> coroutine can be preempted anywhere and there are no such guarantees as
> discussed here, are there?

No, because the gthread-based implementation carefully ensures
that it's only actually allowing one thread to execute at once:
qemu_coroutine_switch() will make the calling thread block until
some other coroutine switches back to it. Any failure to enforce
the coroutine yield semantics would be a bug (and an indication
of why having three separate backends is a bad idea :-))

-- PMM



reply via email to

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