TLS and single/posix thread model in gcc for genode

Christian Prochaska christian.prochaska at genode-labs.com
Fri Dec 13 16:42:13 CET 2019


Hi Alexander,

On 12.12.19 10:58, Alexander Tormasov via users wrote:
> By default, gcc compiled by toolchain says that thread model is single.
> Is it correct? In particular, what’s with TLS (thread local storage), do we need TLS being enabled via —enable-tls option?

There are different ways of using TLS: one is by declaring variables with the '__thread' or 'thread_local' keywords, another one is
by using functions like 'pthread_setspecific()'. The first way is related to the toolchain, which currently uses the 'emutls'
mechanism to provide the feature [1]. The second way is implemented in [2]. So, in general, TLS should work on Genode. The toolchain
still needs to be rebuilt to get thread-safe exceptions (as stated in issue 3418), but this might be unrelated to your problem with
the golang runtime.

Christian

[1] https://github.com/genodelabs/genode/issues/3418
[2] https://github.com/genodelabs/genode/blob/master/repos/libports/src/lib/libc/pthread.cc






More information about the users mailing list