linux 上的 gcc 使用哪个线程库来实现 OpenMP
Which threading library does gcc on linux use to implement OpenMP?
它是否使用pthreads或其他线程API?
是的,Linux 上的 gcc 使用 pthreads。
这取决于你用什么编译GCC,标准的Linux实现带有OpenMP的posix线程,在终端上键入gcc -v
这是我笔记本电脑的输出,感兴趣的部分以粗体显示
[n@N-pc-t61 ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.6.3/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
**Thread model: posix**
以下是海湾合作委员会网站上的所有可用选项
--enable-threads=lib
Specify that lib is the thread support library. This affects the Objective-C compiler and runtime library, and exception handling for other languages like C++ and Java. The possibilities for lib are:
aix
AIX thread support.
dce
DCE thread support.
lynx
LynxOS thread support.
mipssde
MIPS SDE thread support.
no
This is an alias for `single'.
posix
Generic POSIX/Unix98 thread support.
rtems
RTEMS thread support.
single
Disable thread support, should work for all platforms.
tpf
TPF thread support.
vxworks
VxWorks thread support.
win32
Microsoft Win32 API thread support.
相关文章:
- 在c++队列中使用pop和visit实现线程安全
- 尝试从头开始实现Leetcode的FizzBuzz多线程问题。收到"libc++abi.dylib: terminating"错误
- 如果不包含 pthread,为什么 GCC 的线程标准库实现会抛出异常?
- 线程如何在 C++ 中实现
- 实现在多线程代码中安全恢复的断点
- 在C++线程内实现多个计时器的最安全方法
- 我是否需要在 OpenSSL 1.1.0+ 中使用加密锁定函数来实现线程安全?
- 实现多线程后"Project.exe has triggered a breakpoint"
- OpenMP:共享同一算法的单线程和多线程实现
- 线程池 C++ 实现问题
- 如何使用C 11 STD ::线程实现类似Qthread的类
- C++11线程实现后端
- 在 C++11 中使用期货、异步和线程实现搜索
- MSVC 2012 RC std::线程实现中的最大参数数
- C++ STL 算法(列表排序)OpenMP/多线程实现
- 多线程实现中的errno
- MD5暴力攻击高效多线程实现
- Swapcontext在多对多线程实现中失败
- 通过线程实现游戏引擎决定论
- 如何使用POSIX线程实现阻塞读取