xdevel2000
xdevel2000

Reputation: 21444

C and _Thread_local

I read that GCC 4.9 has support for _Thread_local.

Here is said:

ISO C11 thread-local storage (_Thread_local, similar to GNU C __thread) is now supported.

However I installed on Fedora 21 GCC 4.9.1-11 but the include file threads.h is not present.

Any idea?

Does anyone know if there is a compiler with this support?

Upvotes: 0

Views: 450

Answers (1)

R.. GitHub STOP HELPING ICE
R.. GitHub STOP HELPING ICE

Reputation: 215547

_Thread_local should work fine, but it's not very useful, except as a way of making your code thread-safe for somebody else using it with threads, unless you have a way to make threads. The C11 threads API would be provided by libc, not the compiler, and glibc does not support it yet. You can of course use the POSIX threads API.

Upvotes: 2

Related Questions