Bug 14092 - Support C11 threads
Summary: Support C11 threads
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: nptl (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2012-05-10 14:42 UTC by Joseph Myers
Modified: 2017-08-09 21:53 UTC (History)
6 users (show)

See Also:
Last reconfirmed:
fweimer: security-


Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Myers 2012-05-10 14:42:59 UTC
It might be useful for glibc to implement the C11 <threads.h> functionality.


has some comments about how this might be done without having a new shared library.  (However, making pthreadtypes.h stay within the ISO C reserved namespace may be harder than suggested there, because of C++ mangling issues; see how when we gave the union that's pthread_attr_t a tag, it had to be exactly "union pthread_attr_t" to avoid changing the mangling.)
Comment 1 Rich Felker 2012-05-10 15:44:57 UTC
I think it's safe (and probably preferable) NOT to use the same types for C11 threads. This will catch program errors of trying to call a C11 thread function on a POSIX thread object or vice versa. Of course, if it's desirable for the implementations to be shared (and I believe it is), then the corresponding types should have the same *sizes*, and internally the code should just cast away (or spirit it away with weak symbols and fake prototypes) the difference in pointer types.

In any case, I'd like to hear a decision on what glibc intends to do on this issue. I'm aiming to keep the C (but not C++) ABI in musl libc mostly compatible with glibc, and not knowing what sizes glibc intends to use for the C11 mutex, etc. types is preventing me from getting C11 threads implemented.
Comment 2 Fredrik Tolf 2017-02-19 21:10:37 UTC
I am surprised by any lack of progress in this for almost five years. Is there any reason why glibc hasn't added C11 threading support yet, or is it just that no-one has any interest in it?
Comment 3 joseph@codesourcery.com 2017-02-20 16:37:29 UTC
A complicated patch series can be expected to go through many cycles of 
patch review and revision.  At some point, detailed review comments were 
provided for one patch series revision and updated patches did not follow.

I'm not sure what Adhemerval's plans are having picked up those patches 
and put them on the azanella/c11-threads branch (or whether the patches 
there do reflect all the review comments, or whether the various C11 DRs 
relating to the definition of the C11 threads interfaces have been 
reviewed to make sure the implementation properly respects the DR