On 17 June 2015 at 22:36, Emilio G. Cota <c...@braap.org> wrote: > On Wed, Jun 17, 2015 at 09:58:27 +0100, Peter Maydell wrote: >> On 17 June 2015 at 01:52, Emilio G. Cota <c...@braap.org> wrote: >> > I'm having trouble running a simple multithreaded program on a PowerPC >> > host machine. >> > >> > The machine I'm using is a ppc VM--I think it's running under KVM (I'm >> > using >> > OVH's RunAbove Power8 service): >> > admin@adsf:~/qemu$ uname -a >> > Linux adsf 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:27:09 UTC 2014 >> > ppc64le ppc64le ppc64le GNU/Linux >> > >> > admin@adsf:~/qemu$ ppc64le-linux-user/qemu-ppc64le foo >> >> Multithreaded binaries don't work with linux-user; there are a bunch >> of known race conditions involving data structures we don't correctly >> lock or make per-thread. >> >> This is a long-standing issue; we're hoping we might get to fixing >> it some time this year. > > I don't think this is a race because it also breaks when > run on a single core (with taskset -c 0). > > What data structures are you referring to? Are they ppc-specific?
None of the code generation data structures are locked at all -- if two threads try to generate code at the same time they'll tend to clobber each other. > On x86 hosts linux-user works reliably with multithreaded apps. No, it doesn't :-) If any multithreaded app happens to run on any host it is pure fluke. -- PMM