Summaries and notes on pthreads programming.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
src
.gitignore
CMakeLists.txt
README.md
build.sh

README.md

POSIX 多线程程序设计

本项目所有内容摘录自《POSIX多线程程序设计》与《Linux多线程服务端编程:使用muduoC++网络库》部分章节,简化了书中的内容,并提供了完整的源代码实现。

编译、运行

前提,你需要安装 CMake。所有章节源代码都放在 src 目录下,你可以直接编译后运行。

git clone https://github.com/Veinin/programming-with-POSIX-threads-tutorials.git
cd programming-with-POSIX-threads-tutorials
./build.sh

运行实例代码:

$ ./bin/barrier_main
00: (10)0000045001 0000045002 0000045003 0000045004 0000045005 0000045006
01: (11)0000055001 0000055002 0000055003 0000055004 0000055005 0000055006
02: (12)0000065001 0000065002 0000065003 0000065004 0000065005 0000065006
03: (13)0000075001 0000075002 0000075003 0000075004 0000075005 0000075006
04: (14)0000085001 0000085002 0000085003 0000085004 0000085005 0000085006

目录