0% found this document useful (0 votes)
3 views5 pages

2nd Assignment

This document outlines Assignment No. 2 for the Operating System course, detailing various questions across four sections. Section A includes definitions and concepts related to CPU scheduling and process synchronization, while Section B covers scheduling criteria and semaphore operations. Sections C and D involve more complex problems, including algorithms for critical sections, deadlocks, and practical scheduling scenarios with specific processes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

2nd Assignment

This document outlines Assignment No. 2 for the Operating System course, detailing various questions across four sections. Section A includes definitions and concepts related to CPU scheduling and process synchronization, while Section B covers scheduling criteria and semaphore operations. Sections C and D involve more complex problems, including algorithms for critical sections, deadlocks, and practical scheduling scenarios with specific processes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Department of Computer Science and Engineering

ASSIGNMENT SHEETS

ASSIGNMENT NO.2

Date of Notification: _________

Date of Submission: _________

Subject Code: CS-12 Subject Name: Operating


System

SECTION- A (Each question carries 1 mark)

1. Define CPU scheduling.

2. Define process synchronization and interprocess communication.

3. What is aging?

4. List the names of different types of scheduling algorithms.

5. What is starvation in case of priority scheduling?

6. What is the main idea behind shortest job first scheduling (SJFS)?

7. What is critical section problem?

8. Define Race Condition.

9. What is semaphores?

10. What is deadlock?

SECTION- B (Each question carries 2 marks)


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

2. What are the requirements that a solution to the critical section

problem must satisfy?

3. What is convoy effect? Explain with the help of an example.

4. Differentiate between preemptive and non-preemptive scheduling.

5. What is multilevel feedback queue scheduling? Describe with the

help of diagram.

6. What is safe state and an unsafe state?

7. A counting semaphore was initialized to 10. Then 6 P (wait)

operations and 4 V (signal) operations were completed on this

semaphore. What is the resulting value of the semaphore?

8. How counting semaphores can be implemented?

9. Discuss deadlocks and starvation in case of semaphores.

10. Discuss in brief the methods for the handling of deadlocks.

SECTION- C (Each question carries 4 marks)


1. Explain the Peterson’s algorithm for critical section problem.

2. Discuss in brief producer-consumer problem.

3. What are the four conditions necessary for deadlock to happen?

4. Discuss in brief dining philosopher problem.

5. How deadlocks can be prevented?

SECTION- D (Each question carries 6 marks)

1. Consider the following set of processes, with the length of the CPU-

burst time given in milliseconds:

Process Burst Time Priority

P1 10 3

P2 1 1

P3 2 3

P4 1 4

P5 5 2

The processes are assumed to have arrived in the order P1, P2, P3, P4,

P5, all at time 0.

(a) Draw three gantt charts illustrating the execution of these processes
using SJF(preemptive), a non-preemptive priority(a smaller priority

number implies a higher priority scheduling, round robin

schedulingwith time quantum=1.

(b) What is the turnaround time of each process for each of the

scheduling algorithms in part a?

(c) What is the waiting time of each process for each of the scheduling

algorithms in part a?

2. Consider the following snapshot of a system:

Process Allocation Max Available

A B C D A B C D A B C D

P0 0 0 1 2 0 0 1 2 1 5 2 0

P1 1 0 0 0 1 7 5 0

P2 1 3 5 4 2 3 5 6

P3 0 6 3 2 0 6 5 2

P4 0 0 1 4 0 6 5 6

Answers the following questions using the Banker’s algorithm:

a) What is the content of the matrix Need?


b) Is the system in a safe state? If yes, give the sequence.

c) If a request from process P1 arrives for (0,4,2,0) can the

request be granted immediately? If yes, give the sequence.

3. Explain Bakery’s algorithm and check the CS requirements are

satisfied or not.

You might also like