Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3. Design/analysis-based questions. Suggested time to spend on these questions:

ID: 3590659 • Letter: 3

Question

3. Design/analysis-based questions. Suggested time to spend on these questions: 45-50 minutes. [20+20-40pts (a) Consider a slightly different design for the Lottery scheduler than the "traditional" one covered in class: processes are given CPU time proportional to their weights by letting the chosen process P run for ui successive CPU quanta. Let us assume that all weights are positive integers. i. Describe all important aspects of how this scheduler will work (how is a process chosen? what happens upon the creation of a process, e.g., via fork ()? what happens upon the termination of a process, e.g., via exit)?). Use pseudo-code if appropriate. If you can convey your ideas clearly without writing code, that will be just fine. ii. Discuss any pros and cons of this approach vs. the traditional lottery scheduler in terms of: (i) direct overheads, andii) indirect overheads of context switching.

Explanation / Answer

i)Here in this approach we will create a process by using the fork () system call. fork() system call is being used to create a new process. This system call does not take any argument and return the process id of the new process. Here in this scheduling apporach we will create a new child process of an existing process using the fork system call. When ever the process is terminate its calls the exit() system call. When exit() is called then operating system reclaims all the resources that are assigned to that process.

ii) The approach of fork() is better than the traditional approach. The reasons for that are:

1) there are very less direct overhead.
2) The new process is the child of the parent process, so over head are very less.
3) context switching is very easy as well as fast as well

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote