Done By Siim-Morten Ojasalu
Introductory video at: https://youtu.be/mao0nRWR4eQ
The program is called from the commandline with the command "python3 project1.py n", where n is the amount of threads activated.
"python3 project1.py 6" will launch the program with 6 threads running.
Commands available while the program is running:
$ List: This command lists all the nodes and its states. For instance
$ List
- P1, DO-NOT-WANT
- P2, DO-NOT-WANT
- P3, DO-NOT-WANT
- P4, DO-NOT-WANT
- P5, DO-NOT-WANT
- P6, DO-NOT-WANT
$ time-cs t This command sets the time to the critical section for all processes [10, t], meaning that each process takes its critical section holding time randomly from the interval.
For example: "time-cs 20" sets the interval to be [10,20]
$ time-p t This command sets the time-out interval for all processes [5, t], meaning that each process takes its timeout randomly from the interval.
For example: "time-p 20" sets the interval to be [5,20].