用多线程同步方法解决读者阅览问题 1) 每个读者进入阅览室后,即时显示“Entered” 及其线程自定义标识,还同时显示阅览室共有几名顾客及其所坐的位置。 2) 至少有10个读者,每人阅览至少3秒钟。 3) 多个读者须共享操作函数代码。 2总的设计思想及系统平台、语言、工具: 设计思想:程序设定的是10个读者和5个座位,对读者进行编号,依次进入阅览室读书,为每一座位列一表目,包括座号和读者号等,读者离开时要登出,即消掉登记的信息。 系统平台:LINUX 语言:C语言 工具:vi编辑器、gcc编译器 操作系统:linux操作系统 调试工具:edit、masm、link、debug. 3数据结构与模块说明(功能与流程图) 数据结构 int count=0 //记录阅览室读者数量 sem_t full //定义阅览室座位信号量 int seat[5] //用数组表示座位 pthread_t Reader[10] //定义读者线程 pthread_mutex_t mutex //定义互斥量 3.2功能说明 可以标识读者,随机为读者设置在阅览室的读书时间 可以显示阅览室读者的人数 可以显示读者所坐的位置,座位状态以及列出空座位
标签: 多线程同步
上传时间: 2016-08-10
上传用户:zsjzc
非常小的PDF阅读器,使用了PDF控件,需要装有Adobe Reader 才能运行,编译通过。
标签: 阅读器
上传时间: 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.
标签: vblast programs command main
上传时间: 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).
标签: optimizing the structure designed
上传时间: 2013-12-17
上传用户:CHINA526
用20个示例项目的方式介绍Matlab/Simulink。内容包括: *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
标签: Contains Simulink hands-on projects
上传时间: 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.
标签: experimental generation advances enormous
上传时间: 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
上传时间: 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.
标签: the Overview edition wanting
上传时间: 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
标签: administrator Unleashed Edition written
上传时间: 2017-01-13
上传用户:来茴
Java I/O操作,字节流InputStream和OutputStream,字符流Reader和Writer,Java I/O库的设计原则,字符集的编码,RandomAccessFile类,管道流,对象的序列化。
上传时间: 2014-01-16
上传用户:Shaikh