它使用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.
一个OpenMP运行时库是由OdinMP编译器定位的Balder库该库和编译器完全支持包括嵌套并行的OpenMP 2.0。 Balder库有一个模块化的设计,并有几个子库。 一个这样的子库是一个高效的可移植线程库,叫做Balder线程