登录
首页 » 操作系统 » 1.实验目的: 模拟实现银行家算法,用银行家算法实现资源分配。 2.实验内容: 设计五个进程{P0,P1,P2,P3,P4}共享三类资源{A,B,C}的系统,{...

1.实验目的: 模拟实现银行家算法,用银行家算法实现资源分配。 2.实验内容: 设计五个进程{P0,P1,P2,P3,P4}共享三类资源{A,B,C}的系统,{...

于 2022-04-07 发布 文件大小:868.31 kB
0 211
下载积分: 2 下载次数: 1

代码说明:

1.实验目的: 模拟实现银行家算法,用银行家算法实现资源分配。 2.实验内容: 设计五个进程{P0,P1,P2,P3,P4}共享三类资源{A,B,C}的系统,{A,B,C}的资源数量分别为10,5,7。进程可动态地申请资源和释放资源,系统按各进程的申请动态地分配资源。要求程序具有显示和打印各进程的某一时刻的资源分配表和安全序列;显示和打印各进程依次要求申请的资源号以及为某进程分配资源后的有关资源数据。 3.程序设计和说明: 函数说明:anquan( )判断给某个进程请求后系统是否安全,anquan1()判断当前系统是否安全。GetAll()取得所有进程的的各个资源数据。详细说明请参见附录中的程序的文档说明。-1. The experiment : Simulation Algorithm bankers, bankers algorithm with the allocation of resources. 2. Experiment : Design 5 (process P0, P1, P2, P3, P4) (resource sharing three categories A, B, C), (A, B, C) amount of resources to 10,5,7. Dynamic process could apply to the resources and the release of resources, according to the system processes the application to dynamically allocate resources. Procedures required to display and print the process of a moment of the distribution of resources and safety sequence; Display and print the process followed for seeking resources, as well as a process of distribution of resources in the resource data. 3. Program design and description : F

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 兔子吃草
    #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 micro
    一个微型操作系统源码-a micro-source operating system
    2022-02-12 18:05:58下载
    积分:1
  • linux 源码分析,我所见过写的最透彻的。
    linux 源码分析,我所见过写的最透彻的。-linux source code analysis, I see have written most thoroughly.
    2023-01-04 16:10:03下载
    积分:1
  • 学习内存管理模拟实验源代玛
    操作系统学习内存管理模拟实验源代玛-learning operating system memory management simulation source substituting Mary-------------------
    2022-03-03 14:30:36下载
    积分:1
  • 通过IP网络控制服务器,实现BIOS级的控制。
    通过IP网络控制服务器,实现BIOS级的控制。-kvm over ip
    2022-06-30 10:06:12下载
    积分:1
  • ucosii的GUI
    ucos GUI源代码,大家参考参考。不知道为什么字符还不够啊。-ucosii GUI
    2022-06-13 01:19:08下载
    积分:1
  • 本书是讲述VxD和设备驱动程序的权威指南。主要分为两部分。第一部分(第2到第12章)讲述Windows执行环境和VxD。第二部分(第13到第19章)讲述基于DL...
    本书是讲述VxD和设备驱动程序的权威指南。主要分为两部分。第一部分(第2到第12章)讲述Windows执行环境和VxD。第二部分(第13到第19章)讲述基于DLL的驱动程序。本书几乎涵盖了设备驱动程序开发的各个层面,内容全面翔实,可读性较高。 -the book is about the VxD driver and equipment to the authority and guidance. Divided into two main parts. The first part (section 2 of chapter 12) about the implementation of the Windows environment and VxD. The second part (13 to 19) based on the DLL drivers. The book covers almost the device driver development at all levels, as comprehensive and informative, readable higher.
    2023-04-07 17:35:04下载
    积分:1
  • rc500的代码, rc500的代码
    rc500的代码, rc500的代码-rc500 code rc500 code, the code rc5
    2022-10-15 17:30:02下载
    积分:1
  • 程序,计算县城个数,进程名称,进程的管理
    操作系统程序,计算县城个数,进程名称,进程的管理-Operating procedures, the county calculated the number, the process name, process management
    2022-03-26 19:01:24下载
    积分:1
  • Playing
    Playing-with-OS 自己开发操作系统-Playing-with-OS its own operating system
    2022-03-07 00:12:23下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载