[Swan] thread-local storage vs. thread-specific data

Paul Wouters paul at nohats.ca
Sun Oct 6 18:53:47 EEST 2013


On Sun, 6 Oct 2013, D. Hugh Redelmeier wrote:

> Which of these should we use?
>
> thread-specific data:
> - a standard part of POSIX
> - awkward (confusing, complicated)
>
> thread-local storage
> - simple and clean to use
> - part of C11
> - implemented in GCC
>  <http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Thread-Local.html#Thread-Local>

I think it is importated that we also compile on clang. We are looking
at installing ourselves on (jailbroken) iphones and android phones too.

> I would like to use thread-local storage, but fear that it might not
> be supported on all our target platforms.
>
> The platforms most likely to not have it are embedded.  Do they use
> xauth.c?

They will be, as it is the best way to connect back from your phone or
laptop to your home DSL.

Paul


More information about the Swan mailing list