https://github.com/zwldarren/prmanager
https://github.com/zwldarren/prmanager
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/zwldarren/prmanager
- Owner: zwldarren
- Created: 2024-04-22T01:21:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-02T20:30:07.000Z (about 2 years ago)
- Last Synced: 2024-05-03T12:03:28.100Z (about 2 years ago)
- Language: C++
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# P1: Process and Resource Management
This project develops a simple process and resource manager.
## Getting Started
### Usage
To run the project:
```bash
./PRManager --input --output
```
### Building from Source
If you prefer to build from source, follow these steps:
```bash
cmake . -B build
cmake --build build
```
## Command Reference
The following commands are used for input:
| Command | Description |
| ------------- | ------------- |
|in \ \ \ \ \ |Restore the system to its initial state, with n priority levels and resources 0-3 having \, \, \, \ units respectively|
|id |Equivalent to "in 3 1 1 2 3"|
|cr \
| Create a new process at priority level \
. \
can be 1 or 2.|
| de \ | Destroy the process identified by the PCB index \, and all of its descendants |
| rq \ \ | Request \ units of resource \|
| rl \ \ | Release \ units of resource \. \ can be 0, 1, 2, or 3 |
| to | Invoke the timeout function |
For each input command, output the index of the process running next, as a single integer separated by a space.
If an error occurs, output -1.
A new line starts for each in or id command.