qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-thread: add TLS wrappers
Date: Wed, 17 Aug 2011 10:13:58 -0700	[thread overview]
Message-ID: <4E4BF6D6.5040801@redhat.com> (raw)
In-Reply-To: <CAJSP0QW-e6Vbm2uVTSccd7WHZDU2RsD0gzduOiFmM__1AWO3fQ@mail.gmail.com>

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	other threads:[~2011-08-17 17:14 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 [this message]
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
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=4E4BF6D6.5040801@redhat.com \
    --to=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).