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: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] qemu-thread: add TLS wrappers
Date: Wed, 17 Aug 2011 18:26:15 +0100

On Wed, Aug 17, 2011 at 6:13 PM, Paolo Bonzini <address@hidden> wrote:
> 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.

I suggest we simply require that minimum gcc version.

Stefan



reply via email to

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