用多線程同步方法解決讀者閱覽問題 1) 每個(gè)讀者進(jìn)入閱覽室后,即時(shí)顯示“Entered” 及其線程自定義標(biāo)識(shí),還同時(shí)顯示閱覽室共有幾名顧客及其所坐的位置。 2) 至少有10個(gè)讀者,每人閱覽至少3秒鐘。 3) 多個(gè)讀者須共享操作函數(shù)代碼。 2總的設(shè)計(jì)思想及系統(tǒng)平臺(tái)、語言、工具: 設(shè)計(jì)思想:程序設(shè)定的是10個(gè)讀者和5個(gè)座位,對讀者進(jìn)行編號,依次進(jìn)入閱覽室讀書,為每一座位列一表目,包括座號和讀者號等,讀者離開時(shí)要登出,即消掉登記的信息。 系統(tǒng)平臺(tái):LINUX 語言:C語言 工具:vi編輯器、gcc編譯器 操作系統(tǒng):linux操作系統(tǒng) 調(diào)試工具:edit、masm、link、debug. 3數(shù)據(jù)結(jié)構(gòu)與模塊說明(功能與流程圖) 數(shù)據(jù)結(jié)構(gòu) int count=0 //記錄閱覽室讀者數(shù)量 sem_t full //定義閱覽室座位信號量 int seat[5] //用數(shù)組表示座位 pthread_t Reader[10] //定義讀者線程 pthread_mutex_t mutex //定義互斥量 3.2功能說明 可以標(biāo)識(shí)讀者,隨機(jī)為讀者設(shè)置在閱覽室的讀書時(shí)間 可以顯示閱覽室讀者的人數(shù) 可以顯示讀者所坐的位置,座位狀態(tài)以及列出空座位
標(biāo)簽: 多線程同步
上傳時(shí)間: 2016-08-10
上傳用戶:zsjzc
非常小的PDF閱讀器,使用了PDF控件,需要裝有Adobe Reader 才能運(yùn)行,編譯通過。
標(biāo)簽: 閱讀器
上傳時(shí)間: 2016-08-17
上傳用戶:1109003457
The main file in this list of programs is "vblast.m". Type "help vblast" on the command line for details.Study the coding by stepping through the program. These programs require around 5000 packets for reasonable plotting accuracy.This has been implemented for a 2x2 system. The Reader can program other variations. The program has been tested on MATLAB version 6.0 and above with signal processing toolbox and communication toolbox options.
標(biāo)簽: vblast programs command main
上傳時(shí)間: 2016-08-24
上傳用戶:wcl168881111111
This book is designed to be used for the purpose to describe the structure of an optimizing compiler so that a Reader can implement it or a variation (compiler writers always modify a design).
標(biāo)簽: optimizing the structure designed
上傳時(shí)間: 2013-12-17
上傳用戶:CHINA526
用20個(gè)示例項(xiàng)目的方式介紹Matlab/Simulink。內(nèi)容包括: *Contains over 20 hands-on projects in MATLAB(with code) integrated throughout the book *Includes a complete introduction to Simulink *Accompanied by a CD-ROM containing MATLAB examples, source code, third party simulations & projects *Suitable for self-study and professional licensing exams *Designed for the Reader who does not have extensive math and programming experience *Contains many practical applications of MATLAB and Simulink
標(biāo)簽: Contains Simulink hands-on projects
上傳時(shí)間: 2014-01-03
上傳用戶:hj_18
Recent advances in experimental methods have resulted in the generation of enormous volumes of data across the life sciences. Hence clustering and classification techniques that were once predominantly the domain of ecologists are now being used more widely. This book provides an overview of these important data analysis methods, from long-established statistical methods to more recent machine learning techniques. It aims to provide a framework that will enable the Reader to recognise the assumptions and constraints that are implicit in all such techniques. Important generic issues are discussed first and then the major families of algorithms are described. Throughout the focus is on explanation and understanding and Readers are directed to other resources that provide additional mathematical rigour when it is required. Examples taken from across the whole of biology, including bioinformatics, are provided throughout the book to illustrate the key concepts and each technique’s potential.
標(biāo)簽: experimental generation advances enormous
上傳時(shí)間: 2016-10-23
上傳用戶:wkchong
int main(int argc,char *argv[]) { char ch while(true) { printf("*************************************\n") printf(" 1.Reader Priority\n") printf(" 2.Writer Priority\n") printf(" 3.Exit to Windows\n") printf("*************************************\n") printf("Enter your choice(1,2,3): ") do{ ch=(char)_getch() }while(ch!= 1 &&ch!= 2 &&ch!= 3 ) system("cls") if(ch== 3 ) return 0 else if(ch== 1 ) ReaderPriority("thread.dat") else WriterPriority("thread.dat") printf("\nPress Any Key to Coutinue:") _getch() system("cls") } return 0
標(biāo)簽: char int printf while
上傳時(shí)間: 2017-01-06
上傳用戶:gonuiln
Overview If you have been wanting to learn Java, check out the newly revised fourth edition of the best-seller Sams Teach Yourself Programming with Java in 24 Hours. This step-by-step tutorial will teach you how to create simple Java programs and applets. Comprised of 24 one-hour lessons, this new edition focuses on key programming concepts and essential Java basics, has been improved by dozens of Reader comments, and is reorganized to better cover the latest developments in Java. The book s coverage of core Java programming topics has also been expanded. A great starting point for learning Java, this book is also a great primer to reading sams Teach Yourself Java in 21 Days.
標(biāo)簽: the Overview edition wanting
上傳時(shí)間: 2017-01-10
上傳用戶:huyiming139
Unix Unleashed, Third Edition is written with the power user and system administrator in mind. This book will help the Reader understand the nuances of the major Unix variants including SVR4, HP-UX, Solaris, AIX, BSD, IRIX, SunOS, and Linux. It will help the Reader decide which Unix shell works best for their particular situation. Other topics such as Kernel Configuration, Networking, User Administration, and File Management are covered extensively for the administrator who wants a variety of options to choose from for best performance. The book also provides in-depth coverage of configuring and optimizing mail, DNS, HTTP and other services many companies deploy across their intranet and on the Internet
標(biāo)簽: administrator Unleashed Edition written
上傳時(shí)間: 2017-01-13
上傳用戶:來茴
Java I/O操作,字節(jié)流InputStream和OutputStream,字符流Reader和Writer,Java I/O庫的設(shè)計(jì)原則,字符集的編碼,RandomAccessFile類,管道流,對象的序列化。
上傳時(shí)間: 2014-01-16
上傳用戶:Shaikh
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1