-
操作系统兔子吃草
#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
-
This is a FIFO FIFO memory design source
这是一个先进先出FIFO存储器的设计源码-This is a FIFO FIFO memory design source
- 2022-06-19 06:10:09下载
- 积分:1
-
nachos下并发程序设计。编写双向链表并演示并发错误。包含文件Makefile.common、main.cc、threadtest.cc、dllist...
nachos下并发程序设计。编写双向链表并演示并发错误。包含文件Makefile.common、main.cc、threadtest.cc、dllist-driver.cc、dllist.cc、dllist.h、nachos01.doc-concurrent programming under the nachos. List and demonstrate the preparation of two-way concurrent error. Include file Makefile.common, main.cc, threadtest.cc, dllist-driver.cc, dllist.cc, dllist.h, nachos01.doc
- 2022-03-16 07:50:59下载
- 积分:1
-
操作系统排序算法
操作系统排序算法-operating system Sorting Algorithm
- 2022-04-08 20:23:06下载
- 积分:1
-
操作系统内存调度例子
操作系统内存调度例子-operating system memory scheduling example
- 2022-01-26 05:27:43下载
- 积分:1
-
存储分区的可变管理
存储分区的可变管理-variable storage area management
- 2023-05-14 22:05:03下载
- 积分:1
-
2004.7.6日上传的一个有错这是2004.7.7日重新传的。这是本人用汇编和C混合编成的一个32...
2004.7.6日上传的一个有错这是2004.7.7日重新传的。这是本人用汇编和C混合编成的一个32-bit多任务、多线程的操作系统内核。现在暂时不提供原代码但可以下载用。谁有兴趣且觉得自己有能力和我共同完善它最终实现真正的中国本土的高端操作系统请和我联系:yaocong@mail.china.com -2004.7.6 date passes on has mistake this is 2004.7.7 dates
repasses on. This is myself uses the assembly and C mix forming 32-bit
multi- duties, the multi-thread operating system essence. Now
temporarily does not provide the original code but to be allowed to
download uses. Who has the interest also thought oneself has the
ability and I consummates it finally to realize the genuine Chinese
native place high end operating system together please to relate with
me: Yaocong@mail.china.com
- 2023-05-02 10:10:03下载
- 积分:1
-
利用Visual C++进行对话框的各种技巧编写
利用Visual C++进行对话框的各种技巧编写-The use of Visual C++ Dialog to the preparation of a variety of skills
- 2023-04-15 20:25:03下载
- 积分:1
-
这是一个电梯模拟器,使用操作系统的概念叫互斥实现一..
it s a lift simulator, use operating system concept call mutex to implenment a lift. I do it prefectly.-it sa lift simulator, use operating system concept call mutex to implenment a lift. I do it prefectly.
- 2022-01-24 15:55:57下载
- 积分:1
-
汇编语言编程_微机原理实验完整程序代码
实验八 可编程并行I/O接口8255A芯片实验。1、了解8255A芯片的结构和功能。2、掌握8255A初始化程序的设计方法。3、学会8255A和CPU信号的连接方法。
- 2022-12-13 12:10:03下载
- 积分:1