-
操作系统兔子吃草
#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
-
一个小的进程调度
一个小的进程调度-a small Process Scheduling
- 2022-06-19 07:35:27下载
- 积分:1
-
操作系统实验:用信号量解决producer & consumer问题。
包括:
WIN ProCon(1).cpp
WIN ProCon(2).cp...
操作系统实验:用信号量解决producer & consumer问题。
包括:
WIN ProCon(1).cpp
WIN ProCon(2).cpp
LINUX ProCon.c-Operating System Experiment: Using Semaphores solve the producer & consumer issues. Include: WIN ProCon (1). Cpp WIN ProCon (2). Cpp LINUX ProCon.c
- 2022-04-12 20:36:01下载
- 积分:1
-
Running 操作系统-接口及编程 全部资料 !
Running 操作系统-接口及编程 全部资料 !-Running operating system- interface and programming all the information!
- 2022-01-30 12:01:47下载
- 积分:1
-
本文提供在微软的windows家族的操作系统的内核模式驱动程序中分配和使用内存的信息。它描述了驱动程序可用的内存类型,每种类型内存的适当的分配和使用,和测试与内...
本文提供在微软的windows家族的操作系统的内核模式驱动程序中分配和使用内存的信息。它描述了驱动程序可用的内存类型,每种类型内存的适当的分配和使用,和测试与内存有关的问题的最好方法-This article provides Microsoft windows family of operating system kernel mode driver in the distribution and use of memory information. It describes the drivers available memory types, each type of memory appropriate allocation and use, and testing of memory-related issues and the best way to
- 2022-03-03 17:14:04下载
- 积分:1
-
操作系统课程设计,模拟文件系统(unix混合索引方式),此程序是在1周的课程设计中所写,不完善,且代码粗糙。但,希望能给大家一些帮助,也希望能对你们的课程设计有...
操作系统课程设计,模拟文件系统(unix混合索引方式),此程序是在1周的课程设计中所写,不完善,且代码粗糙。但,希望能给大家一些帮助,也希望能对你们的课程设计有所帮助,更希望能有人修改它。谢谢!-courses on operating system design, simulation File System (unix Index Mixed mode), this procedure is the one-week course design is written, imperfect and code rough. However, the hope of giving you some help, and hope they can right your curriculum design help, the hope was modifying it. Thank you!
- 2022-07-07 01:21:11下载
- 积分:1
-
C++编写的一个操作系统程序
C++编写的一个操作系统程序-prepared an operating system procedures
- 2022-07-09 11:23:42下载
- 积分:1
-
飞机选票系统
该程序是一个简单的飞机选票系统,包括
1.系统以菜单方式工作
2.航班信息录入功能(航班信息用文件保存)--输入
3.航班信息浏览功能--输出
4.查询航线(按航班号查询)
5.承办订票和退票业务
- 2022-02-02 02:04:22下载
- 积分:1
-
STM32F103RB ucos2操作系统框架,可以通过串口进行…
stm32f103rb ucos2操作系统框架,可以通过串口发数据-stm32f103rb ucos2 operating system framework that can be made through the serial port data
- 2022-12-12 11:20:03下载
- 积分:1
-
mammual RTX实时操作系统内核。
RTX实时操作系统的内核演示,MDK环境,还不错的。-RTX realtime OS kernel mammual.
- 2022-03-03 06:57:18下载
- 积分:1