Operating System – Part 5 | TPS CS 12th pdf download

Q. 25 Explain the following terms in case of process scheduling
Q. 26 What are preemptive and non-preemptive philosophies of scheduling.
Q. 27 What is priority ? Explain internal and external priorities.
Q. 28 With reference to process management explain the terms
Q. 29 What is multitasking? Explain in brief.

Q. 25 Explain the following terms in case of process scheduling

  Asked in Board Exam   (March 2005, October 2008)     Important  

(a) Turnaround time
(b) Waiting time
(c) Terminal response time
(d) Event response time

Ans : (1) Turnaround time : Turnaround time is the elapsed time between the time a program or a job is submitted and the time when it is completed.

(2) Waiting time : Waiting time is the time a job spends waiting in the queue of the newly admitted processes for the operating system to allocate resources to it before commencing its execution.

(3) Terminal response time : In the Time-sharing system, Terminal response time is the time to respond with an answer or result to a question and it depends on degree of multiprogramming, the efficiency of hardware with OS and policy of OS to allocate resources.

(4) Event response time : In the real-time system, event response time is the to respond
with an event.

Q. 26 What are preemptive and non-preemptive philosophies of scheduling.

Ans : There are basically two scheduling philosophies, depending upon the need. The operating system designers has to select one of them.

Preemptive philosophy :

i) This philosophy allows a higher priority process to replace a currently running process even if its time slice is not over or it has not requested for any external operation.

ii) This requires context switching more frequently.

iii) It is suited for on-line, real time processing, where interactive users and high priority processes require immediate attention.

iv) The preemptive philosophy increases fairness of the system but decreases throughput.

Non-preemptive philosophy :

i) In a non-preemptive philosophy, a running process retains the control of the CPU
and all the allocated resources, until it surrenders control to the operating system (on
its own wish).

ii) This means that even a high priority process enters the system, the running process can not be forced to give up control.

iii) However if the running process is blocked due to some external request another process
can be scheduled.

iv) It is not suited for real time systems, where high priority events requires an immediate attention.

v) Non-preemptive philosophy increases throughput of the system but decreases fairness.

Q. 27 What is priority ? Explain internal and external priorities.

  Asked in Board Exam   (Oct. 2007)     Important  

Ans : 1) The concept of arranging ready processes in a queue so that they can be dispatched one atter another for execution depending on some policy is known as priority.

2) Due to many processes competing for the same available resources like C.P.U. and memory, concept of priority is used.

3) A priority may be external (or global) or internal (or local).

(a) External or global priority :

(1) An external priority is specified by the user externally generally at the time of initiating the process.

(2) In many cases, the operating system allows user to change its priority externally even during its execution.

(3) If the user does not specify any external priority at all, the operating system assumes a certain priority, called the default priority. But when an urgent job needs to be done, the system manager permits the process to be created with a higher priority.

(b) Internal priority or local priority :

(1) The concept of internal priority is used by scheduling algorithms. They base their calculations on the current state of the process eg, each user, while firing a process, can be forced to
specify the expected time that the process is likely to take for completion.

(2) The operating system can then set internal priority, which is highest for the shortest job
(SJF i.e. shortest job first algorithm), so that at only a little extra cost to large job, many short jobs will complete.

(3) This has two advantages : (a) If short jobs are finished faster, the number of processes competing for CPU. will be decreased. (b) The number of satisfied users will increase.

(4) However if a stream of short jobs keeps coming on, an important large job may suffer from indefinite postponement. To avoid this, set higher external priority to important large jobs

Q. 28 With reference to process management explain the terms:

(i) External priority
(ii) Purchased priority
(iii) Internal priority
(iv) Time slice

  Asked in Board Exam   (Mar, 2003, 06, 08, 11,16)     Important  

Ans: (i) External Priority : Please refer Q. No. 27.

(ii) Purchase priority :

(a) This priority is used in some data centre situations where each user pays for the time used.

(b) Higher priority processes are charged at a higher rate to prevent each user from firing his job at the highest priority. This is known as scheme of purchased priority.

(c) Operating system keeps track of the time used by each process and the priority at which it was used.

(iii) Internal priority : Please refer Q. No. 27.

(iv) Time slice :

(a) Each process is normally given certain time to run irrespective of its importance. This is known as Time slice.

(b) Time slice given to each process so that a process does not use the CPU indefinitely.

Q. 29 What is multitasking? Explain in brief.

Ans : (1) A task can be defined as an asynchronous code path within a process.

(2) Hence in operating systems which supports multitasking, a process can be considered to be made up of number of tasks, which can run simultaneously in the same way that a multiuser operating system supports multiple process at the same time.

(3) Just like processes, a task can also have priorities and states.

(4) A task can be in ready, running or blocked states and accordingly task control blocks (TCB) are linked together.

(5) When the operating system schedules a process with multiple tasks and allocates time slice to it, the following happens :

(i) The operating system select the highest priority ready task within that process and schedules it.

(ii) Atany time if the process time slice is over, the operating system turns the process as well as currently runing task into ready state from running state.

(iii) If the process time slice is not over but the current task is either over or blocked, the operating system chooses next highest priority ready task within that process and
schedules it. ’

(iv) If there is no other ready task within that process only then the O.S. turns that process to blocked state.
On the current state of the process e.g. each user, while firing a process, can be forced to, specify the expected time that the process is likely to take for completion.

Q. 30 Explain the term multitasking with a suitable example.

  Asked in Board Exam   (Oct. 2003, 2013)     Important  

Ans :
1) Multitasking : A task can be defined as an asynchronous code path within a process. In multitasking, a process can consist of tasks, which run simultaneously.
2) Multiple tasks should be able to run concurrently within a process.
3) Multitasking allows programmer flexibility and improves CPU utilization.
4) It reduces the overheads of switching at a process level.
5) For example :
Consider a process consisting of two tasks :

Task 0: Read a Record
Process a Record
Task 0 end
Task 1: Write a Record
Task 1 end

(a) Two task are defined within the same process. They run concurrently within the same process if synchronized properly.

(b) If task 0 is blocked, instead of blocking entire process, the operating system will find out whether tasks 1 can be scheduled.

(c) When both tasks are blocked, only then entire process is blocked. Again if one task is
ready, the process can be moved to ready list and then scheduled.

Q. 31 What are the advantages of multitasking operating systems ?

(i) Multitasking O.S. allows programmer flexibility and also improves C.P.U. utilization.

(ii) When various tasks are defined in a process, then process would be blocked only if all the tasks in that process are blocked.

(iii) Again even if any task becomes ready, the process can be moved to ready list from blocked list.

(iv) By adding task levels, context switching at various process levels can be reduced.

(v) Multitasking is less time consuming and it reduces turnaround time.

Click on DOWNLOAD and Operating System Part – 5 pdf will start downloading.

223 KB

  1. Can I download Operating System Part – 5 PDF Free ?

    Yes, you can download TPS Computer Science 12th all Pdf for free. Only you need to click on download button and wait for 30 seconds. Your download will start automatically.

  2. Unable to download the pdf ?

    Please click on the download button and wait for 30 seconds for the downloading link to be generated. After that check your downloads you will get your pdf.

  3. Why I am seeing count down timer after clicking on download button ?

    Please wait for it to complete and then you will able to download it. You are seeing count down timer for downloading link to be generated.


Important Links

Operating System Part -1

Operating System Part -2

Operating System Part -3

Operating System Part -4

Operating System Part -5

Operating System Part -6

Operating System Part -7

Operating System Part -8

Sharing Is Caring:

Leave a Comment