[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 06/13] qemu-thread: add TLS wrappers
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [RFC 06/13] qemu-thread: add TLS wrappers |
Date: |
Thu, 20 Jun 2013 15:26:33 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, 06/14 11:48, Stefan Hajnoczi wrote:
> From: Paolo Bonzini <address@hidden>
>
> Fast TLS is not available on some platforms, but it is always nice to
> use it. This wrapper implementation falls back to pthread_get/setspecific
> on POSIX systems that lack __thread, but uses the dynamic linker's TLS
> support on Linux and Windows.
>
> The user shall call alloc_foo() in every thread that needs to access the
> variable---exactly once and before any access. foo is the name of the
> variable as passed to DECLARE_TLS and DEFINE_TLS. Then, get_foo() will
> return the address of the variable. It is guaranteed to remain the same
> across the lifetime of a thread, so you can cache it.
Would tls_alloc_foo() and tls_get_foo() be easier to read and less
possible for name conflict?
Fam
- [Qemu-devel] [RFC 00/13] dataplane: use block layer, Stefan Hajnoczi, 2013/06/14
- [Qemu-devel] [RFC 01/13] block: fix bdrv_flush() ordering in bdrv_close(), Stefan Hajnoczi, 2013/06/14
- [Qemu-devel] [RFC 02/13] dataplane: sync virtio.c and vring.c virtqueue state, Stefan Hajnoczi, 2013/06/14
- [Qemu-devel] [RFC 03/13] block: add BlockDevOps->drain_threads_cb(), Stefan Hajnoczi, 2013/06/14
- [Qemu-devel] [RFC 04/13] virtio-blk: implement BlockDevOps->drain_threads_cb(), Stefan Hajnoczi, 2013/06/14
- [Qemu-devel] [RFC 06/13] qemu-thread: add TLS wrappers, Stefan Hajnoczi, 2013/06/14
- Re: [Qemu-devel] [RFC 06/13] qemu-thread: add TLS wrappers,
Fam Zheng <=
- [Qemu-devel] [RFC 07/13] block: add thread_aio_context TLS variable, Stefan Hajnoczi, 2013/06/14
- [Qemu-devel] [RFC 09/13] main-loop: use thread-local AioContext, Stefan Hajnoczi, 2013/06/14
- [Qemu-devel] [RFC 10/13] block: disable I/O throttling outside main loop, Stefan Hajnoczi, 2013/06/14
- [Qemu-devel] [RFC 08/13] block: drop bdrv_get_aio_context(), Stefan Hajnoczi, 2013/06/14