基于進(jìn)程的多任務(wù)處理是程序的并發(fā)執(zhí)行识脆。
基于線程的多任務(wù)處理是同一程序的片段的并發(fā)執(zhí)行抵代。
c++多線程編程使用的是linux提供的多線程編程機(jī)制
posix提供的API:
#include <pthread.h>?
創(chuàng)建線程 :pthread_create()
退出線程:pthread_exit()
基于進(jìn)程的多任務(wù)處理是程序的并發(fā)執(zhí)行识脆。
基于線程的多任務(wù)處理是同一程序的片段的并發(fā)執(zhí)行抵代。
posix提供的API:
#include <pthread.h>?
創(chuàng)建線程 :pthread_create()
退出線程:pthread_exit()