freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

操作系統(tǒng)課程設計進程管理、進程間通信(編輯修改稿)

2025-05-04 21:38 本頁面
 

【文章內(nèi)容簡介】 waiting()。 kill(p1,16)。 /*向p1發(fā)軟中斷信號16*/ kill(p2,17)。 /*向p2發(fā)軟中斷信號17*/ wait(0)。 /*同步*/ wait(0)。 printf(parent process is killed!\n)。 exit(0)。 } else { wait_mark=1。 signal(17,stop)。 signal(SIGINT,SIG_IGN)。 /*忽略 ^c信號*/ while (wait_mark!=0)。 lockf(1,1,0)。 printf(child process2 is killed by parent!\n)。 lockf(1,0,0)。 exit(0)。 } } else { wait_mark=1。 signal(16,stop)。signal(SIGINT,SIG_IGN)。 /*忽略^c信號*/ while (wait_mark!=0) lockf(1,1,0)。 printf(child process1 is killed by parent!\n)。 lockf(1,0,0)。 exit(0)。 }}void waiting(){ sleep(5)。if (wait_mark!=0) kill(getpid(),SIGALRM)。}void alarming(){ wait_mark=0。}void stop(){ wait_mark=0。}運行結(jié)果 不做任何操作等待五秒鐘父進程回在子進程縣推出后退出,并打印退出的順序;或者點擊ctrl+C后程序退出并打印退出的順序。〈任務2〉在上面的任務1中,增加語句signal(SIGINT,SIG_IGN)和語句signal(SIGQUIT,SIG_IGN),觀察執(zhí)行結(jié)果,并分析原因。這里,signal(SIGINT,SIG_IGN)和signal(SIGQUIT,SIG_IGN)分別為忽略鍵信號以及忽略中斷信號。程序includeincludeinclude int pid1,pid2。 int EndFlag=0。 int pf1=0。 int pf2=0。void IntDelete(){ kill(pid1,16)。 kill(pid2,17)。}void Int1(){ printf(child process 1 is killed !by parent\n)。 exit(0)。}void Int2(){ printf(child process 2 is killed !by parent\n)。 exit(0)。}main(){ int exitpid。 if(pid1=fork()) { if(pid2=fork()) { signal(SIGINT,IntDelete)。 waitpid(1,amp。exitpid,0)。 waitpid(1,amp。exitpid,0)。 printf(parent process is killed\n)。 exit(0)。 } else { signal(SIGINT,SIG_IGN)。 signal(17,Int2)。 pause()。 } } else { signal(SIGINT,SIG_IGN)。 signal(16,Int1)。 pause()。 }}〈運行結(jié)果〉請讀者將上述程序輸入計算機后,執(zhí)行并觀察。3. 進程的管道通信〈任務〉
點擊復制文檔內(nèi)容
公司管理相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1