Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
642 views
in Technique[技术] by (71.8m points)

multithreading - Does any C library implement C11 threads for GNU/Linux?

There have been a lot of questions about C11 and C11 threading, but I don't see a definitive answer anywhere:

Does any C library implement the C11 threading interface usable on GNU/Linux-like? e.g., provide the "optional" <threads.h> and the thread support library like thrd_create(), from the C11 standard near p. 376.

Ideally, I'd like to find a library that is common-ish, open-source or free, for common/generic/multi architecture (e.g., GNU/Linux, x86_64, or portable-ish).

A few of the more helpful and relevant SO links:

  • this one and this one on glibc;
  • this one that's talking about the standard;
  • this one about clang;
  • this one about C11 in general and this one about Windows and other platforms;
  • a lot more about C++11 threading, but I am only interested in C11.

Some non-starter options for libraries:

I am not interested in POSIX threads (many fine options), Windows, an IDE, nor C++11 (I know that GNU libstdc++ and LLVM/Clang libc++ provide C++11's std::thread, which uses -pthread)

Thanks!


(re-)Edit: question re-opened, so migrated content to answer to clean up.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

musl now (as of Sep 2014-ish) implements C11 threads!

According to this recent musl mailing list post and other conversation on that list in Jul-Sep 2014, it appears that the musl library now (as of 2014-09-07) implements the C11 threads interface, though the comparison chart; does not as of this writing reflect this.

Since this question is re-opened, I moved this content to a proper answer.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...