From: Paolo Bonzini <pbonzini@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-thread: add TLS wrappers
Date: Wed, 17 Aug 2011 10:45:49 -0700 [thread overview]
Message-ID: <4E4BFE4D.2080706@redhat.com> (raw)
In-Reply-To: <CAAu8pHsc1wrJa3rn+QWd1SD9c0ofYY0_BN9KFvKoU+JTKvikMA@mail.gmail.com>
On 08/17/2011 10:37 AM, Blue Swirl wrote:
> > I would agree (just did it for fun and to see how it looks like), but
> > perhaps we can do something similar to what Windows does for OpenBSD too.
> >
> > Though I'm quite disappointed and I must say OpenBSD should enter the 21st
> > century.
>
> I can't justify their design decisions, but isn't __thread a
> non-standard extension by GCC anyway whereas POSIX threads are the
> standard? Are other compilers supporting it?
Visual C++ supports __declspec(thread).
pthread TLS is orders of magnitudes slower than __thread. __thread in
an executable is just as fast as a non-TLS variable access, 2 or 3
machine language instructions at most.
Some pthread_getspecific implementation do a _linear walk_ of the keys.
In that case it may work to have something like Windows plus a single
pthread_getspecific key. On the other hand, Windows provides very good
support for that thanks to its ordered subsections (.tls$something). It
only needs a bit of preprocessor magic. Thinks such as linker scripts
would be way out of scope.
Paolo
next prev parent reply other threads:[~2011-08-17 17:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-16 18:51 [Qemu-devel] [PATCH] qemu-thread: add TLS wrappers Paolo Bonzini
2011-08-17 4:36 ` Brad
2011-08-17 6:55 ` Paolo Bonzini
2011-08-17 17:28 ` Blue Swirl
2011-08-17 17:37 ` Paolo Bonzini
2011-08-17 19:00 ` Richard Henderson
2011-08-17 23:50 ` Brad
2011-08-17 23:51 ` Paolo Bonzini
2011-08-17 16:51 ` Stefan Hajnoczi
2011-08-17 17:13 ` Paolo Bonzini
2011-08-17 17:26 ` Stefan Hajnoczi
2011-08-17 17:28 ` Paolo Bonzini
2011-08-17 17:37 ` Blue Swirl
2011-08-17 17:45 ` Paolo Bonzini [this message]
2011-08-17 17:51 ` Blue Swirl
2011-08-17 18:03 ` Paolo Bonzini
2011-08-17 18:32 ` malc
2011-08-17 23:41 ` Brad
2011-08-17 17:34 ` Blue Swirl
2011-08-17 17:38 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E4BFE4D.2080706@redhat.com \
--to=pbonzini@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.