-
操作系统兔子吃草
#include "stdafx.h"
#include
#include
#include
/*信号量的定义,它是负责协调各个线程, 以保证它们能够正确、合理的使用公共资源。 用于控制进程间的同步与互斥*/
typedef HANDLE Semaphore;
Semaphore g_semBuffer,g_semGlass, g_mutex; //mutex 为互斥锁
// 利用 Windows 下的 API 函数(视窗操作系统应用程序接口)来定义 P、V 操作
#define P(S) WaitForSingleObject(S,INFINITE)
#define V(S) ReleaseSemaphore(S,1,NULL)
#define rate 1000
#define CONSUMER_NUM 4 // 消费者个数
#define PRODUCER_NUM 4 // 生产者个数
#define BUFFER_NUM 4 // 缓冲区个数
char *thing[4]={"glass1","glass2","glass3","glass4"};
//公共的队列缓冲区
struct Buffer
{
int product[BUFFER_NUM];
int front,rear;
}g_buf;
//兔子线程
DWORD WINAPI Rabbit(LPVOID para)
{
int i =*(int*)para; //第 i 只小白兔&
- 2022-05-23 06:18:02下载
- 积分:1
-
TSOT: experimental simulation of a process queue, the queue using linked list fo...
TSOT:实验一 进程队列模拟,队列使用链表形式。
TSOP:实验二 页面请求模拟,生成表单一中的页面地址映射有严重问题,我没有重做。
TAOT:实验三 进程调度。
TAOB:实验四 银行家算法,不能自行设定进程数量,用的是递归算法。-TSOT: experimental simulation of a process queue, the queue using linked list form. TSOP: 2 page requests simulation experiment to generate the page address in the form of a mapping have serious problems, I did not redo. TAOT: Experiment 3 process scheduling. TAOB: Experiment 4 banker" s algorithm, not the number of self-setting process, using a recursive algorithm.
- 2022-08-22 00:34:56下载
- 积分:1
-
Orange s:一个操作系统的实现(书附源码)chapter3.rar
Orange s:一个操作系统的实现(书附源码)chapter3.rar-Orange" s: an operating system implementation (source code attached to the book) chapter3.rar
- 2022-02-05 07:26:32下载
- 积分:1
-
文件系统,9600,fat16,fat32 ,还不错哦
文件系统,9600,fat16,fat32 ,还不错哦-File System, 9600, fat16, fat32, oh well
- 2022-01-25 16:14:31下载
- 积分:1
-
MAC OS X操作系统开发者手册!
MAC OS X操作系统开发者手册! -MAC OS X operating system developers manual!
- 2022-02-12 10:36:26下载
- 积分:1
-
memory management system simulation
模拟内存管理系统-memory management system simulation
- 2022-03-01 04:00:19下载
- 积分:1
-
一个缓冲区管理类, 一个缓冲区管理类。
一个缓冲区管理类, 一个缓冲区管理类。-A buffer zone management, a buffer zone management.
- 2022-05-16 04:48:55下载
- 积分:1
-
Design of communication systems is asp.net technology web
设计中的通讯系统是用asp.net技术实现的基于web的聊天室系统。聊天室是Web服务中最常见的服务-Design of communication systems is asp.net technology web-based chat room system. Chat Web services is the most common services
- 2022-07-01 05:29:34下载
- 积分:1
-
自己动手写操作系统,书的配套光盘。很好的入门级教材,是《操作系统》极好的课设参考资料。...
自己动手写操作系统,书的配套光盘。很好的入门级教材,是《操作系统》极好的课设参考资料。-to write their own operating system, the matching CD. A good entry-level teaching materials, "operating system" excellent lesson based reference materials.
- 2022-02-20 17:40:44下载
- 积分:1
-
操作系统的设计与实现
操作系统的设计与实现-Operating System Design and Implementation
- 2022-04-07 06:06:37下载
- 积分:1