資源簡介
這是一個純用戶級的線程庫的簡單實現,它具備了用戶級線程庫的大部分重要的基本功能。這是一個完全自己編寫的庫,也是本人的一個課程設計,可供初學者參考。設計文檔對線程庫的實現細節進行了具體的說明。
代碼片段和文件信息
/********************************************************************
filename:? test.c
file?ext: c
author: Zhongyi
purpose: Test?program?for?uthreads?lib
*********************************************************************/
#include?“uthreads.h“
/*?Two?thread?procedures?can?have?several?thread?instances?*/
void?f(int);
void?g(int);
int?main(int?argc?char**?argv)
{
int?param1?=?1?param2?=?11?param3?=?100;
int?child_status;
/*?Make?allocation?for?waiting?*/
struct?thread_status?*ts1?=?(struct?thread_status*)malloc(sizeof(struct?thread_status));
struct?thread_status?*ts2?=?(struct?thread_status*)malloc(sizeof(struct?thread_status));
struct?thread_status?*ts3?=?(struct?thread_status*)malloc(sizeof(struct?thread_status));
pid_t?pid;
/*?Initial?uthreads?lib
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????533504??2007-11-15?20:44??操作系統課程設計文檔.doc
?????文件????????281??2007-11-15?20:44??makefile
?????文件???????3500??2007-11-15?20:44??test2.c
?????文件???????3889??2007-11-15?20:44??test.c
?????文件??????14655??2007-11-15?20:44??uthreads.c
?????文件??????13026??2007-11-15?20:44??uthreads.h
?????文件???????4172??2007-11-15?20:44??utility.c
-----------?---------??----------?-----??----
???????????????573027????????????????????7
評論
共有 條評論