Search This Blog

Sunday, July 19, 2009

OPERATING SYSTEM

Q. What are the scheduling criteria and describe them.
Ans: Scheduling criteria: Many criteria have been suggested for CPU scheduling algorithms. The criteria include the following:
1. CPU utilization: Conceptually CPU utilization can range from 0 to 100 percent. In a real system it should range from 40 percent to 90 percent.
2. Throughput: The number of processes that are completed per unit called throughput.
3. Turnaround time: The interval from the time submission to the time of completion is the turnaround time.
4. Waiting time: Waiting time get into memory waiting in the ready queue exactly on the CPU to I/O.
5. Response time: The time from the submission of a request until the first response is produced called response time.
Q. Write down the FCFS scheduling, SJF scheduling, RR scheduling, Priority scheduling, Multilevel queue scheduling, Multilevel feedback queue scheduling (with math).
Ans: FCFS scheduling: The simplest CPU scheduling algorithm is the first-come, first-serve scheduling algorithm. With this scheme, the process that requests the CPU first is allocated the CPU first. The implementation of the FCFS is similar with a FIFO queue. When a process enters the ready queue its PCB is linked onto the tail of the queue.
The FCFS scheduling algorithm is non preemptive. The CPU has been allocated to a process, that process keeps the CPU until it releases the CPU. This algorithm make some troublesome for timesharing systems. There is a convey effect as all the other processes wait for the one big process to get off the CPU.
SJF scheduling: A different approach to CPU scheduling is the shortest-job-first scheduling algorithm. This algorithm associates with each process the length of the processes next CPU burst. A more appropriate term for this scheduling method would be the shortest-next-CPU-burst algorithm, because scheduling depends on the length of the next CPU burst of a process, rather than its total length.
The SJF algorithm can be either preemptive or non preemptive. Preemptive SJF scheduling is sometimes called shortest-remaining-time-first scheduling. The SJF scheduling algorithm is provably optimal, in that it gives the minimum average waiting time for a given set of processes.
Priority scheduling: Another type of CPU scheduling is priority scheduling algorithm. A priority is associated with each process, and the CPU is allocated to the process with the highest priority. Equal priority processes are scheduled in FCFS order. The larger the CPU burst the lower the priority and vice versa. Priorities are generally indicated by some fixed range of numbers, such as 0 to 7 or 0 to 4095. Priorities can be defined either internally or externally.
Priority scheduling can be either preemptive or non preemptive. A major problem with priority scheduling algorithms is identified blocking or starvation.
RR scheduling: The round-robin scheduling algorithm is designed especially for time sharing systems. It is similar to FSFS scheduling, but preemption is added to switch between processes. A small unit of time called a time quantum or time slice is defined and generally from 10 to 100 milliseconds. The performance of the RR algorithm depends heavily on the size of the time quantum
The average waiting time under the RR policy is often long. The RR scheduling algorithm is preemptive.
Multilevel queue scheduling: A multilevel queue scheduling algorithm partitions the ready queue into several separate queues. There must be scheduling among the queues which is commonly implemented as fixed

No comments:

Post a Comment