From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1GHi-0004Np-QS for qemu-devel@nongnu.org; Wed, 28 May 2008 03:41:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1GHh-0004MJ-9a for qemu-devel@nongnu.org; Wed, 28 May 2008 03:41:22 -0400 Received: from [199.232.76.173] (port=44261 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1GHh-0004MD-6I for qemu-devel@nongnu.org; Wed, 28 May 2008 03:41:21 -0400 Received: from il.qumranet.com ([212.179.150.194]:44000) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K1GHg-000374-Hq for qemu-devel@nongnu.org; Wed, 28 May 2008 03:41:20 -0400 Received: from [172.16.16.236] (izike-woof.qumranet.com [172.16.16.236]) by il.qumranet.com (Postfix) with ESMTP id C8EFA250EE4 for ; Wed, 28 May 2008 10:41:15 +0300 (IDT) Message-ID: <483D0C78.8020406@qumranet.com> Date: Wed, 28 May 2008 10:40:40 +0300 From: Izik Eidus MIME-Version: 1.0 Subject: Re: [Qemu-devel] Threading Qemu References: <20080527233155.d05f3f7a3b090fc6839dcb689abb911d.486e192adc.wbe@email.secureserver.net> In-Reply-To: <20080527233155.d05f3f7a3b090fc6839dcb689abb911d.486e192adc.wbe@email.secureserver.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org mixado@mod-x.com wrote: > Hi, > > To make use of all the host CPU cores I'm thinking of adding thread > support to Qemu. > The idea so far is to create one thread for each virtual CPU, and then > run a modified main_loop in each of these threads. > The first step would be to rewrite all the global variables like > first_cpu etc to make it more thread friendly, and make that run in the > current non-threaded version. > > Any hints or tips that I should keep in mind when attempting this? Has > thread support been worked on before but not completed? > it isn't about just give thread for each virtual CPU, you will need to take care that atomic operations will translate from one architecture to another architecture as atomic plus you will need to take care for memory barriers, and many more things (it looks very complex) -- woof.