|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH 1/2] coroutine: introduce coroutines |
Date: | Wed, 25 May 2011 09:32:36 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 |
On 05/24/2011 11:21 PM, Anthony Liguori wrote:
Why not use threads as a coroutine fallback? That's essentially what we would do to be "fully threaded".
Not exactly, there would be much less synchronization going on. Using threads to implement coroutines means you go through the slow path of the synchronization primitives (either mutexes/condvars or barriers) twice or more per coroutine switch. It is really slow, a 100 times difference perhaps.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |