Friday, December 11, 2015

PROCESS SCHEDULING AND SYNCHRONIZATION



1.Define CPU scheduling.

CPU scheduling is the process of switching the CPU among various processes. CPU scheduling is the basis of multiprogrammed operating systems. By switching the CPU among processes, the operating system can make the computer more productive.

2.What is preemptive and nonpreemptive scheduling?

Under nonpreemptive scheduling once the CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or switching to the waiting state. Preemptive scheduling can preempt a process which is utilizing the CPU in between its execution and give the CPU to another process.

3.What is a Dispatcher?

The dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler. This function involves:

  Switching context
  Switching to user mode
  Jumping to the proper location in the user program to restart that program.

4.What is dispatch latency?

The time taken by the dispatcher to stop one process and start another running is known as

dispatch latency.

5.What are the various scheduling criteria for CPU scheduling?

The various scheduling criteria are
  CPU utilization
  Throughput
  Turnaround time
  Waiting time
  Response time


6.Define throughput?

Throughput in CPU scheduling is the number of processes that are completed per unit time. For long processes, this rate may be one process per hour; for short transactions, throughput might be 10 processes per second.

7.What is turnaround time?

Turnaround time is the interval from the time of submission to the time of completion of a

process. It is the sum of the periods spent waiting to get into memory, waiting in the ready queue, executing on the CPU, and doing I/O.

8.Define race condition.

When several process access and manipulate same data concurrently, then the outcome of the execution depends on particular order in which the access takes place is called race condition. To avoid race condition, only one process at a time can manipulate the shared variable.

9.What is critical section problem?

Consider a system consists of 'n' processes. Each process has segment of code called a critical section, in which the process may be changing common variables, updating a table, writing a file. When one process is executing in its critical section, no other process can allowed to execute in its criticalsection.

10.What are the requirements that a solution to the critical section problem must satisfy?

The three requirements are


·         Mutual exclusion
·         Progress
Bounded waiting

 



No comments:

Post a Comment