线程与进程的控制原语对比
| fork | pthead_create |
| exit( int ) | pthead_exit(void *); |
| wait(int *) | pthread_join( ,void **) 阻塞 ;分离 22 ;cancel -1 |
| kill() | pthread_cancel(); 取消点(检查点):系统调用 |
| getpid() | pthread_self(); |
| man 7 pthreads pthread_testcancel(); 查取消点 | |
| pthread_detach(); 分离。 --自动清理pcb。 | |