You are on page 1of 4

COMSATS University Islamabad

(Wah Campus)
CSC322- Operating System Concepts
Sessional – II
BSCS - 5C & BSCS - 5E
Muhammad Qasim
Instructions (Read carefully before attempting the paper)
1. This paper comprise of 15 marks.
2. The time allocated to solve this paper is 60 minutes.
3. The submission can be made on google classroom only within due time.
4. Those who will not attempt this paper and submit it within time limit will be
considered absent and they will not be facilitated to give the sessional again.
5. This is open book paper, you can use your textbook, lecture slides, your own
notes, my video lecture for the reference, however copy paste any answer from
internet source will be canceled and no mark will be awarded for it.
6. In case plagiarism found among the students’ submissions, all those papers will
be considered cancelled, and zero mark will be awarded.
7. If your roll number is odd, you will attempt only highlighted (odd number) parts
of questions, if your roll number is even, you will attempt un-highlighted (even
number) parts of questions.
8. You need to solve this sessional on physical paper in your clear handwriting,
make sure you have written your name, registration number, page number and
section at the bottom of each page.
9. Create the pdf version of the paper by using camscanner, Microsoft lens or any
other tool, but make sure the pictures are cleared, every picture is showing the
students details at bottom, and submit this pdf file via google classroom.
10. Most important double check your paper before submission, you will not be
allowed to submit the paper again if you submitted the wrong version of paper or
anything else.
11. Keep the hardcopy of the paper in safe custody it may be required in future, at
that time failure to submit the hardcopy will be a problem for you.
12. Good luck
Monday, 3 May 2021 10:35:00 AM Student Name: _____________________________
Registration Number: _____________________________
Section: _____________________________
COMSATS University Islamabad
(Wah Campus)
CSC322- Operating System Concepts
Sessional – II
BSCS - 5C & BSCS - 5E
Muhammad Qasim
Question No. 1: ---------Process Synchronization---------CLO-3--------- 6 Marks
1. What is critical section problem, describe it very briefly.

2. What are the requirements for a good solution of critical section problem? describe to the
point and very briefly.

Scenario 1: Suppose you have two processes P1 and P2, and they want to access the only printer
available in the system. Accessing printers by more than one processes at same time is seems to
be a critical section problem, you have two options, either.

3. Use Peterson’s solution in system to solve this problem, also state the advantage and
disadvantage of this approach?

4. Use Hardware based solution to solve this problem, also state the advantage and disadvantage
of this approach?

Scenario 2: Suppose you have five processes P1, P2, P3, P4 and P5, all these five processes are
ready and want to execute their critical section. Your system has capability that two processes
can execute their critical section simultaneously.

5. Use appropriate critical section problem solutions to solve this problem.

6. Consider a banking system that maintains an account balance with two functions:
deposit(amount) and withdraw(amount). These two functions are passed the amount that is to be
deposited or withdrawn from the bank account balance. Assume that a husband and wife share a
bank account. Concurrently, the husband calls the withdraw () function, and the wife calls
deposit (). Describe how a race condition is possible and what might be done to prevent the race
condition from occurring.

Monday, 3 May 2021 10:35:00 AM Student Name: _____________________________


Registration Number: _____________________________
Section: _____________________________
COMSATS University Islamabad
(Wah Campus)
CSC322- Operating System Concepts
Sessional – II
BSCS - 5C & BSCS - 5E
Muhammad Qasim
Question No. 2: ---------Deadlocks-----------CLO-3----------------------- 6 Marks

1. What is difference between Deadlock and Livelock?

2. Very briefly explain the necessary conditions for deadlock to occur?

3. What is difference between deadlock prevention and deadlock avoidance?

4. What is difference between safe state and safe sequence in banker’s algorithm?

Scenario 1: Consider the following snapshot of the system.

Allocation Max
P1 3 0 1 4 5 1 1 7
P2 2 2 1 0 3 2 1 1
P3 3 1 2 1 3 3 2 1
P4 0 5 1 0 4 6 1 2
P5 4 2 1 2 6 3 2 5
Using the banker’s algorithm, determine whether each of the following states is unsafe. If the
state is safe, illustrate the order in which the threads may complete. Otherwise, illustrate why the
state is unsafe.

5.

a. Available = (0, 3, 0, 1)

b. Available = (1, 0, 0, 2)

6.

a. Available = (1,1,1,1)

b. Available = (3,0,0,2)

Monday, 3 May 2021 10:35:00 AM Student Name: _____________________________


Registration Number: _____________________________
Section: _____________________________
COMSATS University Islamabad
(Wah Campus)
CSC322- Operating System Concepts
Sessional – II
BSCS - 5C & BSCS - 5E
Muhammad Qasim
Question No. 3: --------Memory Management-------- CLO-4 ------------- 3 Marks

1. What is difference between logical address space and physical address space?

2. What is difference between Internal and external fragmentation?

3. Briefly explain fixed partition contiguous memory allocation scheme?

4. Briefly explain variable partition contiguous memory allocation scheme?

Monday, 3 May 2021 10:35:00 AM Student Name: _____________________________


Registration Number: _____________________________
Section: _____________________________

You might also like