[Top][All Lists]

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

Re: [Qemu-devel] Qemu threading support?

From: Paul Brook
Subject: Re: [Qemu-devel] Qemu threading support?
Date: Thu, 2 Apr 2009 11:46:31 +0000
User-agent: KMail/1.9.9

On Thursday 02 April 2009, doremi wrote:
> Hello,
> These days I have to add multi-threading support for Qemu (Performace
> is not important for me). 

If performance is not important then why are you trying to do this? There's a 
good chance that the synchronisation overhead will be greater than the  
benefit of using multiple CPU cores. i.e. a multithreaded qemu  will run 
slower than the current single threaded code.

> But it's very complicated, could anybody do me a favor? Thanks

As you say, it's a hard problem. Try searching the mailing lists, this has 
been discussed a several times before.  

Most of qemu is not threadsafe, so needs to be locked appropriately. Chances 
are the only thing you're realistically going to be able to run in parallel 
is the actual translated code. Even then it's not straightforward because you 
have to ensure MMIO callbacks get proper locking. You also have to make sure 
that all atomicity, ordering and coherency guarantees provided by the guest 
ISA are honored. Chances are that guest atomic operations will not be atomic 
after translation, and the host does not provide the memory ordering and 
coherency guarantees that the guest required. These problems can occur even 
for the x86 on x86 because the guest may require strongly ordered regions via 
PAT bits or MTRRs.


reply via email to

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