qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Threading Qemu


From: Paul Brook
Subject: Re: [Qemu-devel] Threading Qemu
Date: Wed, 28 May 2008 14:31:38 +0100
User-agent: KMail/1.9.9

> > plus you will need to take care for memory barriers, and many more things
> > (it looks very complex)
>
> Don't forget _implied_ memory write barrier after every write op on
> x86 target.  With x86 target on hosts where writes are not
> processor-ordered like x86, you need to put a write-write barrier after
> every write - except when you can prove it's not needed.  But that's
> really hard.

Yup. I had a proof of concept implementation that used the TLB to enforce 
per-page exclusive access. This worked, but the locking overhead to achieve 
this was fairly horrible, particularly when you have pages that bounce 
between CPUs frequently (e.g. kernel locks). The nice thing about this is 
that you don't need to do anything special to ensure atomicity, it just 
works.

> Both atomiciy and ordering don't have to be solved if instead you use
> "software scheduled" threads on any architecture - e.g. see GNU Pth.
> Then you won't get real parallelism on a multiprocessor host, but you
> can simulate any multiprocessor target correctly.

That's what qemu currently does.

Paul




reply via email to

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