-
操作系统兔子吃草
#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
-
此代码为PXA270的EBOOT代码,代码包含了所有启动的信息.
此代码为PXA270的EBOOT代码,代码包含了所有启动的信息.-This code for the PXA270
- 2022-03-17 14:15:31下载
- 积分:1
-
μCOSII操作系统开发中文教程详细解释
μCOSII操作系统开发中文教程详细解释-μCOSII operating system tutorials explain in detail the development of Chinese
- 2023-05-11 05:20:04下载
- 积分:1
-
简单的shell 程序
简单的shell 程序-A simple programe of Shell .
- 2023-07-03 06:55:03下载
- 积分:1
-
操作系统试验!通过这个试验,你可以更加详细的了解的一些操作系统方面的知识!...
操作系统试验!通过这个试验,你可以更加详细的了解的一些操作系统方面的知识!-Test operating system! Through this test, you can a more detailed understanding of some of the operating system of knowledge!
- 2022-03-24 18:24:08下载
- 积分:1
-
C function to convert strings. A practical C. handling functions.
C function to convert strings.一个实用的C处理函数。-C function to convert strings. A practical C. handling functions.
- 2022-10-04 13:00:03下载
- 积分:1
-
十大题型算法全实现――(二)可变分区存储管理方案中的内存分配...
十大题型算法全实现――(二)可变分区存储管理方案中的内存分配 -10 types of agrithment implement memory allocate in the variable partion memory management.
- 2022-03-13 03:28:24下载
- 积分:1
-
STM32上移植好的uCOS3嵌入式操作系统
在STM32上移植好的uCOS3嵌入式操作系统,并且能够成功运行。开发工具为MDK , 硬件基于stm32。
- 2022-04-15 05:18:44下载
- 积分:1
-
银行家算法,还不错。有好的请与我联系!
银行家算法,还不错。有好的请与我联系!-bankers algorithm, is not bad. Good please contact me!
- 2022-02-16 03:06:59下载
- 积分:1
-
64k color picture matrix software, embedded environment, you can create matrix
64k色图片字模软件,嵌入式环境下使用,可以制作字模-64k color picture matrix software, embedded environment, you can create matrix
- 2023-02-11 03:25:03下载
- 积分:1