qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Make cpu_single_env thread local (Linux only fo


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH] Make cpu_single_env thread local (Linux only for now)
Date: Wed, 05 Oct 2011 09:52:00 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2011-10-05 09:08, Paolo Bonzini wrote:
> On 10/04/2011 07:26 PM, Jan Kiszka wrote:
>> Looks like a start. But I would avoid macros and go for (static inline)
>> functions where possible. And initialization should be explicit (so that
>> you can start using TLS already inside constructors).
> 
> Here is the patch I wrote to do more or less the same thing, plus
> Windows support.  It's a bit different in that I wrote a macro that can
> be used as lvalue.

Yeah, it probably makes sense to build the abstractions around __thread
so that - one day - we can drop the legacy wrappers.

Just do not prepend "tls__" in the gcc model (there is also some
inconsistency with prefixes in patch 3). And avoid leading "_" unless
they are dictated by the platform. And patch 3 needs to update
darwin-user/main.c as well.

> 
> It doesn't let you use TLS inside constructors, however, unless you use
> constructor priorities.

What is the default priority of constructors BTW? You picked the
highest, will others that do not specify one have the same? Then we
could also define a QEMU_CONSTRUCTOR wrapper with a lower priority.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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