|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH 2/3] Make paio subsystem use threadlets |
Date: | Wed, 20 Oct 2010 08:16:50 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Lightning/1.0b1 Thunderbird/3.0.8 |
On 10/20/2010 04:30 AM, Stefan Hajnoczi wrote:
} else if (acb->ret == -EINPROGRESS) { active = 1; } - mutex_unlock(&lock); if (active) { /* fail safe: if the aio could not be canceled, we wait forwhile (qemu_paio_error(acb) == EINPROGRESS) ; Tight loop with no memory barrier reading a memory location that is updated by another thread. We shouldn't communicate between threads without barriers.
We shouldn't use a tight loop period. A condition should be used if signalling is needed.
And we shouldn't rely on atomic assignments to communicate between threads. Just use a mutex and avoid being fancier than we need to be.
Regards, Anthony Liguori
Stefan
[Prev in Thread] | Current Thread | [Next in Thread] |