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 queuebased scheduler, ignoring almost every other aspect of the OS In this project we will be using message queues for synchronization.
In project we had the children execute in rotation. In this project, instead the oss will be sending messages to child processes based on our queuebased scheduler. In particular, using a multilevel 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 multilevel 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 whenif 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 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 indicating that it is now a free slot.
Our scheduling algorithm
In this project we will be using a multilevel feedback queue of three levels. That is we will have queues, let us call them q q and q q is the highest priority queue, q is the lowest priority queue. q should schedule processes for 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 to a user process, that would indicate it was being given a time quantum of If it received a back, the oss would read that as the user process used ns before it terminated. If it got a back, it would indicate it used before it had an io interrupt. If it got 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
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.
:
csAssignmentSprin...
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 procs simult timelimitForChildren
i intervalInMsToLaunchChildrenf logfile
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
