Re: [Qemu-devel] [PATCH 2/6] coroutine-lock: add limited spinning to CoMutex

2017-02-16 Thread Stefan Hajnoczi
On Mon, Feb 13, 2017 at 07:12:40PM +0100, Paolo Bonzini wrote: > Running a very small critical section on pthread_mutex_t and CoMutex > shows that pthread_mutex_t is much faster because it doesn't actually > go to sleep. What happens is that the critical section is shorter > than the latency of

[Qemu-devel] [PATCH 2/6] coroutine-lock: add limited spinning to CoMutex

2017-02-13 Thread Paolo Bonzini
Running a very small critical section on pthread_mutex_t and CoMutex shows that pthread_mutex_t is much faster because it doesn't actually go to sleep. What happens is that the critical section is shorter than the latency of entering the kernel and thus FUTEX_WAIT always fails. With CoMutex