qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu-thread: add TLS wrappers


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] qemu-thread: add TLS wrappers
Date: Wed, 17 Aug 2011 10:13:58 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0

On 08/17/2011 09:51 AM, Stefan Hajnoczi wrote:
Hmm...this is pretty ugly low-level stuff.  glib provides portable TLS
although I have found __thread significantly faster on Linux.

I think our options are:
1. Use __thread and require recent gcc versions on Windows.  Not as
fast as native Windows TLS.
2. Implement our own TLS abstraction to use native TLS on each platform.
3. Use glib TLS (GStaticPrivate).  It's slower than __thread on Linux
but seems portable.

Options 1 and 3 seem better because they do not involve us
reimplementing yet more platform abstractions.

True, but I'm afraid we'll need to reimplement more of them sooner or later, for example for PI locks. QEMU's needs in this area are just more low level than GLib's, though we could surely use glib's other threading primitives such as the thread pool.

Do you know which Windows gcc versions support __thread and if it
would be reasonable to require those versions?

It's probably 4.3 and newer, or something like that.

Paolo



reply via email to

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