0% found this document useful (0 votes)
22 views

Operating system

Uploaded by

Souvik Gon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Operating system

Uploaded by

Souvik Gon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Assignment- 1 (Topic: Process Synchronization)

1. Explain race condition with the help of an example in context of process synchronization.
2. What are co-operating processes? Discuss the advantages of co-operating processes.
3. Explain Peterson’s solution for avoiding race condition.
4. What is critical section problem?
5. State the solution to the critical section problem w.r.t satisfying the requirements.
6. What is Bounded Buffer problem? Explain with the solution.
Assignment- 2 (Topic: Process Synchronization)

1. How to implement a solution to the Readers-Writers problem with the use of semaphores.
2. What are semaphore and mutex in context to process synchronization?
3. State producer consumer problem. Give a solution to the producer consumer problem using
semaphore. Justify your solution guarantees mutual exclusion.
4. How does the monitor give the solution for a synchronization problem? What is binary
semaphore?
5. Describe the two basic operations on semaphore. Explain whether any integer variable can act
as semaphore or not.
6. Discuss dining philosopher’s problem and device an algorithm for the solution using
semaphores.
7. What are the problems of busy wait implementation of semaphore.
Assignment- 3 (Topic: Deadlock)

1. “All unsafe states may not lead to deadlock.” – why or why not?
2. i) What is deadlock?
ii) Justify the following statement:
‘Cycle in resource allocation graph does not always imply the occurrence of deadlock.’
3. What are the necessary conditions for deadlock to occur?
4. Differentiate between starvation and deadlock.
5. Describe the deadlock prevention strategies.
6. What are safe and unsafe states?
7. Explain the deadlock detection mechanism in case of single instance of each resource type.
8. What is the optimistic assumption made in the deadlock detection algorithm? How this
assumption can be violated?
9. Explain circular wait for the occurrence of deadlock and how it could be prevented?
10. Consider n system consisting of m resources of the same type being shared by n processes
only one at a time. Show that the system is deadlock free if the following conditions holds:
(a) The maximum need of each process is between 1 and m resources.
(b) The sum of all maximum needs is less than m+n.

Consider the following snapshot of a system:

Process Allocation Max Available


ABCD ABCD ABCD
P1 0012 0012 1520
P2 1000 1750
P3 1354 2356
P4 0632 0652
P5 0014 0656

Answer the following question using the Banker’s algorithm:


1. What is the content of matrix “Need”?
2. Is the system in a safe state?
3. If a request from process P1 arrives for (0,4,2,0) can the request be granted immediately?
Assignment- 4 (Topic: Deadlock)

1. Consider the following snapshot of a system:

Process Allocation Max Available


ABC ABC ABC
P0 010 753 332
P1 200 322
P2 302 902
P3 211 222
P4 002 433

Answer the following questions using the Banker’s algorithm:


1. What is the content of matrix “Need”?
2. Is the system in a safe state?
3. If a request from process P1 arrives for (1,0,2) can the request be granted immediately?

2. Consider the following snapshot of a system:

Process Allocation Request Available


ABC ABC ABC
P0 010 000 000
P1 200 202
P2 303 000
P3 211 100
P4 002 002

Answer the following questions using the deadlock detection algorithm:


1. Is the system in a deadlocked state?
2. Suppose that P2 makes one additional request for an instance of type C. If this request is
granted then check whether deadlock occurs or not?

3. Explain banker’s safety algorithm.


4. Consider a system with 5 processes P0 through P4 and have three resource types A,B,C. Find out
the number of instances of each resource type and retrieve the safe sequence.

Process Max Need Available


ABC ABC ABC
P0 753 743 230
P1 322 020
P2 902 600
P3 222 011
P4 433 431

5. Consider the following snapshot of a system:

Process Allocation Max Available


ABCD ABCD ABCD
P1 0012 0012 2100
P2 2000 2750
P3 0034 6656
P4 2354 4356
P4 0332 0652

Answer the following question using the Banker’s algorithm:


1. What is the content of matrix “Need”?
2. Is the system in a safe state?
3. If a request from process P3 arrives for (0,1,0,0) can the request be granted immediately?

6. Explain deadlock detection algorithm.


Assignment-5

1. a) Define a process. Explain the different states of a process.


b) What is a PCB? Why is it required? 5
2. Explain “Long Term Scheduler”, “Short Term Scheduler” and “Medium Term
Scheduler”.
3. a) Define the term “Context Switching” and “Co-operating Process”.
b) What is the optimization criteria for scheduling in a system? 5
4. a) How many types of queues are required to be maintained during scheduling?
Explain.
b) What is Preemptive and Non-Preemptive Scheduling? 5
5. Briefly explain the scheduling criteria for comparing different CPU scheduling
algorithms.
6. Suppose that the following processes arrive for execution at the times indicated:
Process Arrival Time Burst Time
P1 0.0 8
P2 1.0 4
P3 3.0 1
P4 4.0 3
What is the average turnaround time and waiting time for the processes with the FCFS
scheduling algorithm and Round –Robin Scheduling algorithm(time quantum=2ms) ?
5
7. Suppose that the following processes arrive for execution at the times indicated:
Process Arrival Time Burst Time
P1 0.0 12
P2 1.0 7
P3 3.0 5
P4 4.0 2
What is the average waiting time and turnaround time for these processes with
preemptive and non-preemptive SJF algorithm? 5
8. a) What is dispatcher and dispatch latency?
b) What is multilevel queue scheduling and multilevel feedback queue scheduling? 5

You might also like