On 29/04/2016 08:26, Fam Zheng wrote:
> > +if (to_wake) {
> > +Coroutine *co = to_wake->co;
> > +qemu_coroutine_wake(co->ctx, co);
> > +goto out;
> > +}
> > +
> > +/* Some concurrent lock() is in progress (we know this because of
> > +
On Fri, 04/15 13:32, Paolo Bonzini wrote:
> +/* The wait records are handled with a multiple-producer, single-consumer
> + * lock-free queue. There cannot be two concurrent pop_waiter() calls
> + * because pop_waiter() can only come when mutex->handoff is zero. This can
> + * happen in three case
This uses the lock-free mutex described in the paper '"Blocking without
Locking", or LFTHREADS: A lock-free thread library' by Gidenstam and
Papatriantafilou. The same technique is used in OSv, and in fact
the code is essentially a conversion to C of OSv's code.
Signed-off-by: Paolo Bonzini
---