Question: Please provide the complete projecT in C Purpose In this project, you will simulate the process scheduling part of an operating system. You will implement

Please provide the complete projecT in C
Purpose
In this project, you will simulate the process scheduling part of an operating system. You will implement a queue-based scheduler, ignoring almost every other aspect of the OS. In this project we will be using message queues for synchronization.
In project 3, we had the children execute in rotation. In this project, instead the oss will be sending messages to child processes based on our queue-based scheduler. In particular, using a multi-level feedback queue.
Task
As in the previous project, you will have two executables, oss and worker. The oss executable will be launching workers and oss will be maintaining a system clock. However, we have a few more details.
In particular, oss will now send a message to processes based on our scheduling algorithm, which will be a multi-level feedback queue. This mechanism will be discussed in the next section. For now, assume that oss will call some function that would tell it which of the children to send a message to.
To keep track of necessary information, oss will maintain a process table (consisting of Process Control Blocks, one for each process) as we did in the previous project. However, we do need some additional fields. In particular, processes will now have a possibility of being blocked. We then need to keep track of when/if they are blocked and when they will become unblocked.. I suggest making your process table an array of structs of PCBs, for example:Note that your process table is limited in size and so should reuse old entries. That is, if the process occupying entry 0 finishes, then the next time you go to launch a process, it should go in that spot. When oss detects that a process has terminated, it can clear out that entry and set its occupied to 0, indicating that it is now a free slot.
Our scheduling algorithm
In this project we will be using a multi-level feedback queue of three levels. That is, we will have 3 queues, let us call them q0, q1 and q2. q0 is the highest priority queue, q2 is the lowest priority queue. q0 should schedule processes for 10ms, with the
amount of time associated with each queue doubling. If a process was scheduled from some queue, when it sends a message back (assuming it used its full time), it would then be put in the next lowest queue. Processes scheduled from the lowest priority queue would go back into that same queue.
When we have to schedule a process, that is pick one to send a message to, we always prefer any process in a higher priority queue and take the one at the head of that queue.
Processes can be "blocked" on events as we will talk about later. If this happens, a process would not go into this queue but instead go into a blocked queue. Once they become unblocked, then they would go back in the highest priority queue.
Communication between processes
As described previously, the oss will be communicating with the user processes to "schedule" them. These messages should not simply be put into the queue for any to read, but instead sent from oss directly to a particular user process. When the user process is finished with its task, it will send a message back to oss, and only oss, that it is now done with its time quantum. The message sent should be at least (could be more if you want to add more) a number, indicating how much time quantum they will be scheduled for. The message back can also be an integer, positive to indicate how much time they used up, negative if they indicate they are terminating after using some time. For example, if oss sent 500000 to a user process, that would indicate it was being given a time quantum of 500000ns. If it received a -2500 back, the oss would read that as the user process used 2500ns before it terminated. If it got a 2500 back, it would indicate it used 2500 before it had an i/o interrupt. If it got 500000 back, the oss would understand that to mean the process used its entire time quantum.
worker, the children
The worker takes in two command line arguments, this time corresponding to how many seconds and nanoseconds it should decide to stay around in the system (based on our parameter i in the same fashion as we used for the last project. For example, if you were running it directly you might call it like (note that oss launches this when you are actually running the project):
./worker 5500000
This time will act as an overall limit in how much time it will run, but that will be in addition to some percentage chance to terminate.
10:120
cs4760Assignment4Sprin...
The task of oss is to launch a certain number of worker processes with particular parameters. These numbers are determined by its own command line arguments.
Your solution will be invoked using the following command:
oss proc][-s simul][-t timelimitForChildren]
[-i intervalInMsToLaunchChildren][-f logfile]
Please provide the complete projecT in C Purpose

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 Programming Questions!