An open API service indexing awesome lists of open source software.

https://github.com/255doesnotexist/bankers_algorithm


https://github.com/255doesnotexist/bankers_algorithm

Last synced: 29 days ago
JSON representation

Awesome Lists containing this project

README

          

# 银行家算法实现

这是一个使用 Rust 实现的银行家算法系统,用于进行死锁避免的资源分配管理。

同时也是燕山大学操作系统课程的第一个小作业。本人在寒冷的 11 月完成全部内容。仅供参考,请勿抄袭。

因仅是一个小作业,程序中可能无法用于生产实际,更适合作为教学演示程序。仓库的 commit log 也非常杂乱,请勿参考。

## 使用说明

1. 系统会从以下文件读取初始数据:
- available.txt: 可用资源向量
- max.txt: 最大需求矩阵
- allocation.txt: 当前分配矩阵

2. 使用方法:
```bash
cargo run --release
```

3. 运行后,系统会:
- 显示初始状态
- 执行安全性检查
- 进入交互式资源请求处理循环

## 开发环境

- Rust 2021 Edition
- 依赖包:
- colored = "2.1.0" (美化输出)
- prettytable = "0.10.0" (表格显示)

## 测试

系统包含多个测试用例,可以通过以下命令运行:

```bash
cargo test
```