scheduling system

Job ID: 30740360

Budget: $250 – $750 USD

You are required to write a program that activates N threads (N is given via command line, ? < 10 ). The program
implements an internal scheduling system for its N threads.
The scheduler picks a thread to run from a queue, according to its priority. To schedule a thread, it uses a taskWake.
A thread relinquishes the processor in a preemption point. The scheduler is invoked each T seconds (T defaults to 1, but
may changed via the command line as an argument to the program).
To simulate an external interrupt, the scheduler may also be invoked via a user signal. This is done by sending a
SIGUSR1 signal to the process, through the use of the Linux CLI kill utility (man kill). The scheduler changes the run
queue to execute first the threads by the time of scheduling and not by their priority. For example, if the queue is :
[8,4,7] but the scheduling order (in time) was 4, 7, and lastly 8, then the queue is re-ordered to reflect this and becomes
[4,7,8].