Question: i do have the code schedule.c and the rest. but i just want to know if someone can help me. so i can figure out

i do have the code schedule.c and the rest. but i just want to know if someone can help me. so i can figure out how to attach the files.

we only have to complete the steps from 1 to 8.

i do have the code schedule.c and the rest. but i just

want to know if someone can help me. so i can figure

out how to attach the files. we only have to complete the

steps from 1 to 8. In this assignment, we are to simulate

a time-sharing system by using signals and timers. The data structure and

In this assignment, we are to simulate a time-sharing system by using signals and timers. The data structure and worker thread have been well implemented with semaphore. You will focus on implementing the scheduling algorithm (Round Robin). Since we can not change actual "time slices" in OS we use interval timers to model it. The scheduler is installed with an interval timer The timer starts ticking when the scheduler picks a thread to use the CPU which in turn signals the thread when its time slice is finished thus allowing the scheduler to pick another thread and so on. When a thrcad has completely finished its work it leaves the scheduler to allow a waiting thread to enter. Please note that in this project, only the timer and scheduler send signals. The threads passively handle the signals without signaling back to the scheduler The goal of this project is to help you understand (1) how signals and timers work, and (2) hovw to evaluate the performance of your program. (3) understand how the POSIX:TMR interval timer works. You will first implement the time-sharing system using timers and signals. Then, you will evaluate the overall performance of your program by keeping track of how long each thread is idle, running, etc The program takes a number of arguments. Argl determines the number of jobs (threads in our implementation) created; arg2 specifies the queue size of the scheduler. Arg3 through argN gives the duration (the required time slices to complete a job) of each job. Hence if we create 2 jobs, we should supply arg3 and arg4 for the required duration. You can assume that the autograder will always supply the correct number of arguments and hence you do not have to detect invalid input. The program will use these four signals SIGALRM: sent by the timer to the scheduler, to indicate another time quantum has passed. SIGUSR: sent by the scheduler to a worker, to tell it to suspend SIGUSR2: sent by the scheduler to a suspended worker, to tell it to resume SIGTERM: sent by the scheduler to a worker, to tell it to cancel. All code that does this will be in scheduler.c Part I: Modify the scheduler code The start code uses the scheduler thread to setup the timer and handle the scheduling for the system. The scheduler handles the SIGALRM events that come from the timer, and sends out signals to the worker threads. In this assignment, we are to simulate a time-sharing system by using signals and timers. The data structure and worker thread have been well implemented with semaphore. You will focus on implementing the scheduling algorithm (Round Robin). Since we can not change actual "time slices" in OS we use interval timers to model it. The scheduler is installed with an interval timer The timer starts ticking when the scheduler picks a thread to use the CPU which in turn signals the thread when its time slice is finished thus allowing the scheduler to pick another thread and so on. When a thrcad has completely finished its work it leaves the scheduler to allow a waiting thread to enter. Please note that in this project, only the timer and scheduler send signals. The threads passively handle the signals without signaling back to the scheduler The goal of this project is to help you understand (1) how signals and timers work, and (2) hovw to evaluate the performance of your program. (3) understand how the POSIX:TMR interval timer works. You will first implement the time-sharing system using timers and signals. Then, you will evaluate the overall performance of your program by keeping track of how long each thread is idle, running, etc The program takes a number of arguments. Argl determines the number of jobs (threads in our implementation) created; arg2 specifies the queue size of the scheduler. Arg3 through argN gives the duration (the required time slices to complete a job) of each job. Hence if we create 2 jobs, we should supply arg3 and arg4 for the required duration. You can assume that the autograder will always supply the correct number of arguments and hence you do not have to detect invalid input. The program will use these four signals SIGALRM: sent by the timer to the scheduler, to indicate another time quantum has passed. SIGUSR: sent by the scheduler to a worker, to tell it to suspend SIGUSR2: sent by the scheduler to a suspended worker, to tell it to resume SIGTERM: sent by the scheduler to a worker, to tell it to cancel. All code that does this will be in scheduler.c Part I: Modify the scheduler code The start code uses the scheduler thread to setup the timer and handle the scheduling for the system. The scheduler handles the SIGALRM events that come from the timer, and sends out signals to the worker threads

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!