是否有C库实现C11线程为GNU / Linux? [英] Does any C library implement C11 threads for GNU/Linux?

查看:320
本文介绍了是否有C库实现C11线程为GNU / Linux?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有过 很多关于C11和C11线程的问题,但我没有看到一个明确的答案的任何地方:

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

确实的任何的C库实施类似于Linux的GNU /可用的C11螺纹接口例如,提供可选的<螺纹.H> 线程支持库 thrd_create(),从的C11标准近页。 376。

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.

在理想情况下,我想找到一个库,常见十岁上下,开源或免费的,普通/通用/多架构(例如,GNU / Linux的,x86_64的,或便携式十岁上下)。

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).

一些比较有用的和相关的SO链接:

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:

  • glibc library does not; there is an open bug since 2012; there was GSoC proposal but seems not accepted;
  • LLVM/Clang project does not have a C library;
  • musl library does not; -- now does! See edit below and answer.
  • Newlib library supports threading (docs), but not using pthread nor C11 threads;
  • uClibc does not;
  • this comparison chart, which is dubious (e.g., I see no evidence in musl sources for C11 thread-local storage support);
  • Some various posts about BSD,
  • Pelles, which appears closed and Windows-only.

我的感兴趣的POSIX线程(许多精美的期权),Windows中,一个IDE,也不是C ++ 11(我知道,GNU 的libstdc ++ 和LLVM / Clang的的libc ++ 提供C ++ 11的的std ::线程,它采用 -pthread

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)

谢谢!

(重新)编辑:问题重开,所以迁移的内容来回答清理

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

推荐答案

MUSL 现在(截至2014年9月十岁上下的)实现C11线程!

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

根据最近这次MUSL邮件列表的帖子和其他对话上的​​在07月2014年9月该名单,现在看来,的现在MUSL 库(截至2014年9月7日),实现了线程C11接口,虽然的对比图;不写这篇文章的反映出这一点。

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.

这篇关于是否有C库实现C11线程为GNU / Linux?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆