SimpleScheduler implementation (WITH BONUS) -
To run the code we have to do the following set up
gcc -o SimpleScheduler.out SimpleScheduler.c
./SimpleScheduler.out <NCPU> <Time Slicee>
Commands we accept in our SimpleShell include
history
exit
submit <process command> <(optional) priority between 1 and 4>
We also have dummy_main.h that helps with the creation and behaviour of new processes. Purpose of dummy_main is to replace the main function of the process we are running with the dummy main and then getting to execute out small snippet of code before executing the actual process.
This ensures that as soon as the process is created it goes to sleep and doesn't accidently execute a bit of it while the parent is still sending the sigkill signal it would send otherwise. Thus we need it.
Aside from this to be able to handle a seemingly infinite number of processes, we have a linked list structure instead of an array.
We have a mutex on the process queues to avoid race conditions.
For ease of testing we have 3 codes that you can make processes of, namely fib.c, hello_world.c, instructions.c
All of these have #include “dummy_main.h” to accomodate the dummy_main functions and signal handling.
We have also created four queues which represent different priorities. We also display the mean of the waiting and executing durations along with the variance of them.
We had the following observations -
There has been equal contribution by both members in the project
Akshat Patiyal 2023062 - Mutex and process execution
Dhruv Jaiswal 2023200 - Process Managment and scheduling