Bug 14092 - Support C11 threads
: Support C11 threads
Status: NEW
Product: glibc
Classification: Unclassified
Component: libc
: 2.15
: P2 normal
: ---
Assigned To: Not yet assigned to anyone
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-05-10 14:42 UTC by Joseph Myers
Modified: 2012-05-10 15:44 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

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.

http://sourceware.org/ml/libc-alpha/2011-12/msg00059.html

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.