Operating System 1 : Chapter 3 : EXAM PREPARATION : TYBCS : SPPU

 Chapter 3 Process Scheduling 

1 mark

c) What is role of dispatcher?

Answer:


(a) Task Assignment: Assigns tasks to available processors or cores.

(b) Context Switching: Manages the context switch between processes.

(c) Scheduling: Determines which process to execute next.

(d) Resource Allocation: Allocates resources like CPU time to processes.

(e) Error Handling: Manages errors and exceptions during execution.


(b) What is dispatch latency ? 

Answer: 

(a) Definition: Time delay between the decision to execute a process and the actual start of its execution.

(b) Causes: Mainly due to the time required for context switching and preparing the system for the new process.

(c) Impact: Longer dispatch latency can degrade system responsiveness.



---h) What do you mean by I/O bound process?

Answer: (a) Definition: A process that spends a significant amount of time waiting for input/output operations to complete.

(b) Characteristics: Utilizes less CPU time, frequently in a blocked state while waiting for I/O operations.

(c) Example: File processing or network communication tasks.




i) Define the term dispatcher?

Answer: 

The dispatcher is a component of the operating system responsible for managing the execution of processes by making decisions on task scheduling, allocating resources, and handling context switches.


4 mark

(a) What is co-operating processes ? Explain two fundamental models of inter-process communication. 

Answer: (a) Definition: Processes that can share data and information with each other.

Two fundamental models are:


1) Message Passing Model: Processes communicate by exchanging messages through a communication mechanism provided by the operating system.

2) Shared Memory Model: Processes share a region of memory, allowing them to read and write data to communicate.



e) Write difference between preemptive and non preemptive scheduling?





a) Define process. Explain process state diagram in brief.



b) Explain first fit, best fit, worst fit, next fit algorithm.

Answer: 

(a) First Fit: Allocates the first available block that is large enough.

(b) Best Fit: Allocates the smallest available block that satisfies the request.

(c) Worst Fit: Allocates the largest available block; may lead to fragmentation.

(d) Next Fit: Similar to first fit but starts searching from the last allocated block.


Q. Give any four criteria for computing various scheduling algorithms.

Answer: Following are the criterias:


(a) CPU Utilization: Maximizing CPU usage to enhance system throughput.

(b) Throughput: Number of processes completed in a unit of time.

(c) Turnaround Time: Total time taken to execute a process, including waiting and execution.

(d) Waiting Time: Total time a process spends waiting in the ready queue.


(i) Explain the process of CPU-I/O burst cycle with neat diagram.

Answer:


The CPU-I/O Burst Cycle is the cycle through which the processes have to go during its execution. Almost all processes have to switch between CPU (for processing) and I/O devices (for performing I/O) during their execution.


CPU Burst : This is the period when a process actively utilizes the CPU for computation.

During this phase, the process executes instructions and performs calculations.

The length of the CPU burst varies depending on the nature of the task and the process itself.


I/O Burst: This is the period when a process is waiting for an input/output operation to complete.

During this phase, the process is blocked, and the CPU is idle.

Common I/O operations include reading from or writing to files, network communication, or other external devices.


The cycle begins with a CPU burst as the process starts executing.

When an I/O operation is requested, the process enters the I/O burst phase, waiting for the operation to complete.

After the I/O operation finishes, the process returns to the CPU burst phase to continue computation.