https://github.com/255doesnotexist/bankers_algorithm
https://github.com/255doesnotexist/bankers_algorithm
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/255doesnotexist/bankers_algorithm
- Owner: 255doesnotexist
- Created: 2024-10-31T04:24:31.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-03T10:16:25.000Z (about 1 year ago)
- Last Synced: 2025-03-01T05:28:23.919Z (10 months ago)
- Language: Rust
- Size: 1.13 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```