Operating System Chapterwise Notes of Galvin:CPU Scheduling

Pages>> 1 2 3 4 5 6 7 8
Here we are giving chapter wise notes of operating system based on operating system concepts by galvin
CPU Sheduling

q) what is idea behind multiprogramming?
a) a process is executed till it has to wait, generally for I/O request.then cpu given to some other process.

note:- the process execution consists of series of cpu and i/o bursts, starting and ending with cpu burst only.

q) when a process can go from running state to ready state directly?
a) when an interuppt occurs.

q) what is non-preemptive scheduling?
a) here once cpu is given to a process, then the process release it only if it terminates ot need to do i/o. windows3.1 is
eg.

q) what are cases to be considered in case of preemptive scheduling?
a) (we here may need timer)
case1:- a process in middle of updating a data is preempted, other process after it tries to use that inconsistent data.
case2:- when kernel data structures are inconsistent, then preemption should not take place.

q) what is a dispatcher?
a) it gives control of cpu to a process selected by cpu scheduler. its functions are:-
1) context switch.
2) switch to user mode.
3) jump to proper location in program to restart it.

q) what is dispatch latency?
a) time taken by dispatcher to stop 1 process and start another.

q) what is throughput?
a) it is defined as the number of processes completed per unit time.

q) what is response time?
a) it is time between submission of process to first response is produced.

note:- fcfs can be implemented using a queue.when a process is given cpu, then its pcb is removed from queue.

q) what is gantt chart?
a) it is used to find waiting time in case of cpu scheduling algorithms.

q) what is convoy effect?
a) it occurs in case of fcfs scheduling.it occurs as small processes wait in queue for big process to leave cpu.

note:- fcfs is non-preemptive, hence not at all suitable for time-sharing systems.

q) what is key logic of shortest job first scheduling algorithm?
a) here algorithm associates with each each process latter's next cpu burst. cpu is given to process with smallest next cpu
burst.

q) what is difficulty with SJF?
a) knowing the length of next cpu burst. it is generally used in long term scheduling.

q) can we implement it at the cpu level?
a) it is difficult to know next cpu burst length. to implement it cpu burst time is predicted on the basis of the previous
ones.

q) what is nature of SJF?
a) it can be preemptive(SRT) as well as non-preemptive.

q) what is priority scheduling?
a) here with each process a priority is attached, and process with highest priority is selected for cpu.

q) how to define these priorities?
a) can be defined internally or externally:-
*internally:- by factores like memory requirements,number of open files,ratio of average i/o burst and cpu burst.
*externally:- importance of process,funds paid, political factors.

note:- it can be preemptive or non-preemptive.

q) what is indefinite blocking or starvation?
a) a system where stream of high priority processes comes continously, then a low priority process in queue, keeps waiting
indefinitely.

q) what is solution to this?
a) solution is aging.here we keep on increasing the priority of a process waiting for long time after some fixed time, till
it becomes high priority process and gets executed.

q) what is RR scheduling?
a) it is special for time sharing systems.here timer also is set before process execution starts.

note:- the time unit above is called time quantum or time slice.

time quantum must be large than the context switch as context switch time is included in the time slice.

q) where we can use multilevel-queue-scheduling?
a) where we can classify the processes easily.some common categories are:- interactive processes,background(batch) processes,
system processes.

q) what is logic for multilevel queues?
a) separate processes in separate queues, each having its own scheduling needs.like interactive processe need RR and batch
processes can be done using FCFS.

note:- now ready queue is splitted into separate queue,on basis of type of process, and there must be scheduling among queues
also.

q) what is technique used in Solaris2?
a) higher order queues need be done before a lower level queue.if control in lower queue and a process come in higher order
, preemtion is required.

note:- time slice can also be used between the queues.

q) how is multilevel-feedback-queue scheduling different from multilevel-queues?
a) here the processes can move between the queues. here logic is to separate processes on basis of cpu burst.if process uses
too much cpu time, it is moved to lower queue.

q) what we do for load sharing in multi-processor scheduling?
a) use only 1 queue and schedule on to available processor. here each processor can select a process from queue for itself.
or a master-slave relationship is used.here 1 processor schedules other processors.other processors only execute user-code.


q) how process is submitted in hard real-time systems?
a) here process is given along with statement of amount of time it needs to complete or do I/O. here the scheduler then
admits process with guarantee that it will complete on time or it will reject it as impossible. it is called resource
reservation.

note:- here the scheduler must know that how much time each o.s function takes.

q) how to keep dispatch latency low in case of soft-real time processes?
a) to preempt system calls.in long duration system calls, preemption points are introduced,where check is made to see if
higher priority process wants to run. preemption points need to placed at safe positions. but only few preemption points
can be added to a system process.

Pages>> 1 2 3 4 5 6 7 8

Reblog this post [with Zemanta]

0 comments:

Post a Comment