qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] iothread: stash thread ID away


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/2] iothread: stash thread ID away
Date: Tue, 25 Feb 2014 17:27:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Il 25/02/2014 17:17, Stefan Hajnoczi ha scritto:
For the default mutex type (PTHREAD_MUTEX_TIMED_NP) glibc looks safe to
me.  The other mutex types are trickier and I haven't audited them.

It also depends on the low-level lock implementation. I looked at the C one and it's not safe, the x86-optimized one is hard to follow.

I think I was looking at a different race, namely cases where the locking thread uses a fast path, while the unlocking thread plays it safe and uses the slow path instead. Then the slow path can run "asynchronously" from the locking thread, and the locking thread has time to unlock and destroy the mutex. See the other message.

Paolo



reply via email to

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