Skip to main content

Operating System (OS) Interview Questions And Answers - Part X.



46. What Are Schedulers & What Are Types Of Schedulers?

Schedulers are special system software which handles process scheduling in various ways. Their main task is to select the jobs to be submitted into the system and to decide which process to run.

Schedulers are of three types:
  • Long Term Scheduler.
  • Short Term Scheduler.
  • Medium Term Scheduler.


47. Explain The Importance Of Long Term Scheduler, Short Term Scheduler & Medium Term Scheduler?

Long Term Scheduler is also called job scheduler. Long term scheduler determines which programs are admitted to the system for processing. Job scheduler selects processes from the queue and loads them into memory for execution. Process loads into the memory for CPU scheduling. The primary objective of the job scheduler is to provide a balanced mix of jobs, such as I/O bound and processor bound. It also controls the degree of multiprogramming. If the degree of multiprogramming is stable, then the average rate of process creation must be equal to the average departure rate of processes leaving the system.

On some systems, the long term scheduler may not be available or minimal. Time-sharing operating systems have no long term scheduler. When process changes the state from new to ready, then there is use of long term scheduler.

Short Term Scheduler is also called CPU scheduler. Main objective is increasing system performance in accordance with the chosen set of criteria. It is the change of ready state to running state of the process. CPU scheduler selects process among the processes that are ready to execute and allocates CPU to one of them.

Short term scheduler also known as dispatcher, execute most frequently and makes the fine grained decision of which process to execute next. Short term scheduler is faster than long term scheduler.

Medium Term Scheduler removes the processes from the memory. It reduces the degree of multiprogramming. The medium term scheduler is in-charge of handling the swapped out-processes. Medium term scheduling is part of the swapping.


48. State The Difference Among Short-Term, Medium-Term & Long-Term Scheduling?

Short-term scheduling (or Dispatching) allocates CPU time to processes in memory. It determines which of the ready processes can have CPU resources, and for how long.

Medium-term scheduling swaps processes out of memory and reinstates them, to be run, at a later time, as in a time-sharing system. It determines when processes are to be suspended and resumed.

Long-term scheduling determines which programs are admitted to the system for execution and when, and which ones should be exited.

A common difference, other than their defined tasks, is also how frequently each scheduler is called.

Basic differences between the three are:

  • Long Term Scheduler is a job scheduler; Short Term Scheduler is a CPU scheduler; Medium Term Scheduler is a process swapping scheduler.
  • Speed is fastest for Short term Scheduler among the three.
  • Long Term Scheduler controls the degree of multiprogramming; Short Term Scheduler provides lesser control over degree of multiprogramming; Medium Term Scheduler reduces the degree of multiprogramming.


49. Explain The Difference Between Response Time & Turnaround Time. These Times Are Both Used To Measure The Effectiveness Of Scheduling Schemes.

Turnaround time is the sum of the periods that a process is spent waiting to get into memory, waiting in the ready queue, executing on the CPU, and doing I/O. Turnaround time essentially measures the amount of time it takes to execute a process. Response time, on the other hand is a measure of the time that elapses between a request and the first response produced.



50. Define Preemptable Resource & Non Preemptable Resource. Give Examples?

A preemptable resource is one which can be allocated to a given process for a period of time, then be allocated to another process and then be reallocated to the first process without any ill effects.

Examples of preemptable resources include
  • Memory
  • Buffers
  • CPU
  • Array processor

A nonpreemptable resource cannot be taken from one process and given to another without side effects. One obvious example is a printer: certainly we would not want to take the printer away from one process and give it to another in the middle of a print job.


ALSO READ:

51. What Is A Thread? Why Is It Used?
52. What Are The Advantages Of Threads?
53. What Are The Types Of Threads In Operating System?
54. What Are The Differences Between User Level Threads & Kernel Supported Threads?
55. State The Advantages & Disadvantages Of User Level Threads?


56. State The Advantages & Disadvantages Of Kernel Level Threads?
57. State The Basic Differences Between Process & Thread?
58. What Are The Advantages Of Threads Over Multiple Processes?
59. What Are The Disadvantages Of Threads Over Multiple Processes?
60. Why Should A Web Server Not Run As A Single Threaded Process?

... Return To Operating System FAQ's Index.

... Return To Homepage.

Comments

Popular posts from this blog

Tell Me Something About Yourself - Interview Answers.

Try to introduce some of your most important employment-oriented skills as well as your education and accomplishments to the interviewer. Answer to this question is very important because it positions you for the rest of the interview . That's why this statement is often called the "Positioning Statement". One should take the opportunity to show his/her communication skills by speaking clearly and concisely in an organized manner. Since there is no right or wrong answer for this question hence it is important to appear friendly. YOUR ANSWERS CAN BE: 1) I am a person with strong interpersonal skills and have the ability to get along well with people . I enjoy challenges and looking for creative solutions to problems. 2) Besides the details given in my resume, I believe in character values, vision and action. I am quick in learning from mistakes. I am confident that the various tests that you have conducted will corroborate my competencies apti...

What Is (Are) Your Weakness (Weaknesses)? - Interview Answers

There’s a saying – “However small the thorn maybe it has the ability to pierce.” Never say you are a Workaholic, a Perfectionist, etc. because it sounds negative. Try to convert these negative biased qualities into positive ones. For Example, In   place of Workaholic you can say you are a hard worker and always willing to work for extra hours. In place of Perfectionist , you can say you are detail oriented and like to set high standard for work. “Try to specify your weakness as your strength and also highlight it as a benefit.” Your answers can be: 1) One of my weaknesses as I perceive is occasional compromise on time for quality and perfection. 2) I feel I am not very detail-oriented . I’m a person that wants accomplish as much as possible. I realized this hurts quality and therefore I‘m trying hard to find a balance between quality and quantity. 3) At times even when I need help, I try to solve my own problems instead of asking a co-worker who might know...

What Is (Are) Your Strengths? - Interview Answers

This is a simple and popular interview question. Generally people answer it in two ways. There are people who simply state their strength like “I am Young, Dynamic, Intelligent, Smart and so on…”. Such answer is neither right nor wrong but does not help u in any way also. Secondly there are peoples who state their strengths and explain them how he can use his strength for the job and industry. Do not simply state your strength. Everyone has some strength, all you need is to convert them into benefits. In short, try to advertise yourself by converting your features into strengths. “EVERYONE CLAIM THEY ARE HONEST, HARDWORKING, SMART AND SO ON….. BUT WITH AN EXAMPLE IT IS MUCH MORE BELIEVABLE.” Your answers can be : 1) I am a hard worker and because of this ability I can work for additional hours to accomplish my tasks.I am commitment oriented and hence I always enjoy the trust and confidence of my team mates which enables me to perform my duties very easily. 2) I am a...