線程與進程的控制原語對比
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。 |