|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH 16/19] Rename get_tls to tls_var |
Date: | Tue, 06 Dec 2011 13:04:43 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 |
On 12/06/2011 12:43 PM, Andreas Färber wrote:
Am 06.12.2011 12:01, schrieb Stefan Hajnoczi:From: Jan Kiszka<address@hidden> get_tls() can serve as a lvalue as well, so 'get' might be confusing.Note that this does not work for POSIX pthread_getspecific(), which we'll need to support at some point in time, so I don't think this is a terribly good idea.
I already posted the code for pthread_getspecific(), but it didn't work on OpenBSD.
The idea was to reserve a single pthread key and allocate a whole block of memory. Then get_tls can use pthread_getspecific() and add an offset within the block of memory. The reason is that with many allocated keys pthread_getspecific() becomes slower.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |