91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

天津大學(xué)計(jì)算機(jī)專業(yè)操作系統(tǒng)課程資料,包括課上PPT 軟件專業(yè)往年題(和計(jì)算機(jī)專業(yè)考的差不多)三四次上機(jī)的實(shí)驗(yàn)報(bào)告和代碼。

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?

pthread_mutex_t?lock?=?PTHREAD_MUTEX_INITIALIZER;
int?t?N;
long?double?ans?=?0;

long?double?Pi(int?start?int?end){
long?double?ans?=?0;
????for(int?i?=?start;?i????? ans?+=?4/(1?+?(((double)i?+?0.5)/N)*(((double)i?+?0.5)/N))/N;
????}
????return?ans;
}

void?get_parameter(){
printf(“Please?input?N:“);
scanf(“%d“?&N);
printf(“Please?input?the?number?of?the?threads:“);
scanf(“%d“?&t);
}

int?if_continue(){
printf(“Input?1?to?continue?0?to?terminate:“);
int?loop;
scanf(“%d“?&loop);
return?loop;
}

void?*thread(void?*ID)
{??????
int?id?=?(int)ID;
pthread_mutex_lock(&lock);

int?step?=?N?/?t;
long?double?thread_ans?=?Pi(id?*?step?(id?+?1)?*?step);
ans?+=?thread_ans;
?????
? pthread_mutex_unlock(&lock);
? return?(void*)0;
}

int?main(){
????int?loop?=?1;
????
????while(loop){
???? ans?=?0;
???? get_parameter();
????
???? pthread_t?*threads;
???? threads?=?(pthread_t*)malloc(sizeof(pthread_t)?*?t);
????
???? for(int?i?=?0;?i??? pthread_create(&threads[i]?NULL?thread?(void*)(long)i);
?? }
??
?? for(int?i?=?0;?i? ??? ?????pthread_join(threads[i]?NULL);
?? }
??
?? printf(“Pi?is:%.15LF\n“?ans);
??
???? loop?=?if_continue();
????}


????return?0;
}







































?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-01-25?19:56??操作系統(tǒng)\
?????文件????20094393??2018-10-18?11:37??操作系統(tǒng)\UNIX環(huán)境高級(jí)編程第二版.pdf
?????文件????????4028??2018-11-03?23:59??操作系統(tǒng)\debug.log
?????目錄???????????0??2019-01-25?19:56??操作系統(tǒng)\吳老師課件\
?????文件?????2477662??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\01.Introduction.pdf
?????文件??????588752??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\02.Processes.pdf
?????文件??????984779??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\03.Threads.pdf
?????文件??????426724??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\04.Scheduling.pdf
?????文件?????1058479??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\05.Race-Semaphore.pdf
?????文件??????923791??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\06.IPC.pdf
?????文件??????306562??2019-01-12?21:39??操作系統(tǒng)\吳老師課件\07.Deadlock.pdf
?????文件??????706560??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\Linux01-安裝與使用.ppt
?????文件?????1106432??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\Linux02-文件與目錄.ppt
?????文件??????589824??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\Linux03-進(jìn)程管理.ppt
?????文件??????629248??2019-01-12?21:37??操作系統(tǒng)\吳老師課件\Linux04-使用shell.ppt
?????文件??????584704??2019-01-12?21:38??操作系統(tǒng)\吳老師課件\Linux05-編寫shell?script.ppt
?????文件???????16084??2019-01-12?21:39??操作系統(tǒng)\吳老師課件\ex01.pv.docx
?????文件???????23381??2019-01-12?21:39??操作系統(tǒng)\吳老師課件\ex02.process.docx
?????文件???????24110??2018-01-06?22:04??操作系統(tǒng)\吳老師課件\課后習(xí)題11.30.doc
?????文件???????30720??2017-12-20?14:08??操作系統(tǒng)\吳老師課件\隨堂練習(xí)11.30.doc
?????目錄???????????0??2019-01-16?11:45??操作系統(tǒng)\復(fù)習(xí)\
?????文件???????16084??2019-01-11?19:59??操作系統(tǒng)\復(fù)習(xí)\ex01.pv.docx
?????文件???????23381??2019-01-11?19:59??操作系統(tǒng)\復(fù)習(xí)\ex02.process.docx
?????文件???????14336??2018-01-08?19:46??操作系統(tǒng)\復(fù)習(xí)\os總復(fù)習(xí)-1.doc
?????文件?????1054451??2019-01-12?00:42??操作系統(tǒng)\復(fù)習(xí)\os總復(fù)習(xí)-2.doc
?????文件?????1565696??2019-01-12?00:40??操作系統(tǒng)\復(fù)習(xí)\os總復(fù)習(xí)-3.doc
?????文件?????4343887??2017-11-23?18:06??操作系統(tǒng)\復(fù)習(xí)\現(xiàn)代操作系統(tǒng)(中文第三版)習(xí)題答案.pdf
?????文件?????1328775??2019-01-15?00:45??操作系統(tǒng)\復(fù)習(xí)\簡(jiǎn)答.docx
?????目錄???????????0??2019-01-11?20:03??操作系統(tǒng)\復(fù)習(xí)\考研題\
?????文件??????941222??2017-12-30?10:56??操作系統(tǒng)\復(fù)習(xí)\考研題\2009年考研計(jì)算機(jī)統(tǒng)考真題及答案解析.pdf
?????文件??????945217??2017-12-30?10:55??操作系統(tǒng)\復(fù)習(xí)\考研題\2010年考研計(jì)算機(jī)統(tǒng)考真題及答案解析.pdf
............此處省略51個(gè)文件信息

評(píng)論

共有 條評(píng)論

相關(guān)資源