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

正文內(nèi)容

生產(chǎn)者與消費(fèi)者算法(編輯修改稿)

2025-06-12 06:54 本頁面
 

【文章內(nèi)容簡介】 r_produce_。 int temp =j。 while(temp){ char c = (char)(temp%10)。 lp+=c。 temp/=10。 } h_Semaphore[j+1]=CreateSemaphore(NULL,0,n_Thread,())。 } //創(chuàng)建生產(chǎn)者和消費(fèi)者線程; for(i =0。i (int) n_Thread。i++){ if(Thread_Info[i].entity ==39。P39。) h_Thread[i]= CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)(Produce), amp。(Thread_Info[i]),0,NULL)。 else h_Thread[i]=CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)(Consume), amp。(Thread_Info[i]),0,NULL)。 } //主程序等待各個線程的動作結(jié)束; wait_for_all = WaitForMultipleObjects(n_Thread,h_Thread,TRUE,1)。 printf( \n \nALL Producer and consumer have finished their work. \n)。 printf(Press any key to quit!\n)。 _getch()。 return 0。}//確認(rèn)是否還有對同一產(chǎn)品的消費(fèi)請求未執(zhí)行;bool IfInOtherRequest(int req){ for(int i=0。in_Thread。i++) for(int j=0。jThread_Info[i].n_request。j++) if(Thread_Info[i].thread_request[j] == req) return TRUE。 return FALSE。}//找出當(dāng)前可以進(jìn)行產(chǎn)品生產(chǎn)的空緩沖區(qū)位置;int FindProducePosition(){ int EmptyPosition。 for (int i =0。in_Buffer_or_Critical。i++) if(Buffer_Critical[i] == 1){ EmptyPosition = i。 //用下面這個特殊值表示本緩沖區(qū)正處于被寫狀態(tài); Buffer_Critical[i] = 2。 break。 } return EmptyPosition。}//找出當(dāng)前所需生產(chǎn)者生產(chǎn)的產(chǎn)品的位置;int FindBufferPosition(int ProPos){ int TempPos。 for (int i =0 。in_Buffer_or_Critical。i++) if(Buffer_Critical[i]==ProPos){ TempPos =
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1