-pthread Adds support for multithreading with the pthreads library. This option sets flags for both the preprocessor and linker.
pthread is a thread library under linux. If you use multi-threading, you need to link to this library. At this time, you need to add -pthread to the compilation options. Or -lpthreadpthread是linux下的线程库,用了多线程就要链接这个库,这时候要在编译选项上增加-pthread或者-lpthread
POSIX threads, or Pthreads for short, is the POSIX standard for threads. This standard defines a complete set of APIs for creating and manipulating threads. In Unix-like operating systems (Unix, Linux, Mac OS X, etc.), Pthreads are used as the threads of the operating system.
pthread
is a thread library underlinux
. If you use multi-threading, you need to link to this library. At this time, you need to add-pthread
to the compilation options. Or-lpthread
pthread
是linux
下的线程库,用了多线程就要链接这个库,这时候要在编译选项上增加-pthread
或者-lpthread
-pthread
选项对 预处理器和链接器起作用而老式的
-lpthread
只对链接器起作用推荐使用
-pthread
-pthread
option works on preprocessor and linkerwhile the old
-lpthread
only works on linkerIt is recommended to use
- pthread
🎜POSIX threads, or Pthreads for short, is the POSIX standard for threads. This standard defines a complete set of APIs for creating and manipulating threads. In Unix-like operating systems (Unix, Linux, Mac OS X, etc.), Pthreads are used as the threads of the operating system.