wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Deadlock

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

What is the main problem that the Critical Section problem aims to solve?

a)

Deadlock

b)

Process Synchronization

c)

Paging

d)

Fragmentation

2.

Which of the following is NOT a necessary condition for a solution to the Critical Section problem?

a)

Mutual Exclusion

b)

Progress

c)

Bounded Waiting

d)

Starvation

3.

Which synchronization mechanism can be used to solve the Critical Section problem?

a)

Semaphore

b)

paging

c)

Demand Paging

d)

Thrashing

4.

Which of the following statements about Critical Section is true?

a)

It is a part of the program where shared resources are accessed

b)

It always leads to deadlock

c)
  • It prevents concurrent execution

d)

It only occurs in single-threaded programs

5.

Which of the following is NOT a classical solution to the Critical Section problem?

a)

Peterson’s Algorithm

b)

Bakery Algorithm

c)

Dekker’s Algorithm

d)

Round-Robin Scheduling

6.

What is the primary goal of synchronization in operating systems?

a)

Preventing deadlock

b)

Managing CPU scheduling

c)

Ensuring orderly execution of concurrent processes

d)

Increasing memory size

7.

Which of the following is NOT a synchronization mechanism?

a)

Semaphore

b)

Monitor

c)

Mutex

d)

Fragmentation

8.

Which type of semaphore can have only two values, 0 and 1?

a)

Binary Semaphore

b)

Counting Semaphore

c)

Mutex

d)

None of the above

9.

Which of the following synchronization mechanisms uses condition variables?

a)

Semaphore

b)

Monitor

c)

Mutex

d)

Spin lock

10.

What does the Producer-Consumer problem deal with?

a)

Process Scheduling

b)

Process Synchronization

c)

Deadlock Avoidance

d)

Memory Allocation

11.

Which data structure is commonly used to implement the buffer in the Producer-Consumer problem?

a)

Stack

b)

Queue

c)

Linked List

d)

Graph

12.

Which synchronization mechanism is typically used to solve the Producer-Consumer problem?

a)

Semaphore

b)

Paging

c)

Segmentation

d)

Fragmentation

13.

Which condition must be checked before a consumer consumes an item?

a)

Battery is empty

b)

Battery if full

c)

Producer is waiting

d)

None of the Above

14.

What is the primary purpose of a Mutex Lock?

a)

Process scheduling

b)

Deadlick

c)

Ensuring mutual exclusion in critical sections

d)

memory Management

15.

How many processes can hold a Mutex Lock at a time?

a)

1

b)

2

c)

3

d)

0

16.

What happens when a process tries to acquire a Mutex Lock that is already held by another process?

a)

It gets the lock immediately

b)

It waits until the lock is released

c)

It enters the critical section

d)

It terminates

17.

What happens when a process tries to acquire a Mutex Lock that is already held by another process?

a)

It gets the lock immediately

b)

It waits until the lock is released

c)

It enters the critical section

d)

It terminates

18.

Which of the following is true about Mutex Locks?

a)

They allow multiple processes to access a resource simultaneously

b)

They help achieve process synchronization by mutual exclusion

c)

They do not require any waiting mechanism

d)

They are used for memory allocation

19.

What is the key difference between a Mutex and a Binary Semaphore?

a)

Mutex can be acquired by multiple processes, but a Binary Semaphore cannot

b)

Mutex has ownership, while a Binary Semaphore does not

c)

Binary Semaphore allows only one process at a time, but Mutex does not

d)

Mutex is used for signaling, while a Binary Semaphore is not

20.

What is the initial state of a Mutex Lock?

a)

Locked

b)

Unlocked

c)

Waiting

d)

Suspended

21.

Which problem can arise if a Mutex Lock is not released properly?

a)

Deadlock

b)

Fragmentation

c)

Thrashing

d)

Paging

22.

Which function is used to acquire a Mutex Lock in a multithreading environment?

a)

release()

b)

wait()

c)

lock()

d)

acquire()

23.

Which of the following operations are performed on a Mutex Lock?

a)

wait() & signal()

b)

lock() & unlock()

c)

allocate() & free()

d)

open() & close()

24.

What is the key advantage of using Mutex Locks over spinlocks?

a)

No CPU time is wasted when waiting

b)

It allows multiple processes in the critical section

c)

It does not require mutual exclusion

d)

It prevents deadlock completely

25.

Which of the following issues can be resolved using a Mutex Lock?

a)

Deadlock

b)

Race condition

c)

Fragmentation

d)

Thrashing