wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Chapter 4_IPC_Synchronization

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the main purpose of process synchronization?

a)

To execute all processes at the same time


b)

To avoid deadlock in the system

c)

To coordinate processes accessing shared resources

d)

To speed up CPU execution

2.

What is a race condition?

a)

When two processes compete for CPU time


b)

When multiple processes access shared data and the final result depends on which finishes last

c)

When processes execute one after another

d)

When a process runs faster than expected

3.

What is the critical-section problem?

a)

A problem caused by too many threads


b)

A situation where processes need to access shared data one at a time

c)

An issue caused by faulty synchronization hardware

d)

A memory management problem

4.

Which of the following is not a requirement for solving the critical-section problem?

a)

Mutual exclusion

b)

Progress

c)

Infinite waiting

d)

Bounded waiting

5.

What does a process do when it enters a critical section using a lock?

a)

It acquires exclusive access to a shared variable

b)

It releases all resources

c)

It pauses until the next process arrives

d)


It waits for user input

6.

In the TestAndSet mechanism, what happens if the lock is already set (locked)?

a)

The process continues into the critical section


b)

The process must wait until the lock is released

c)

The process deletes the lock variable

d)

The process resets the system

7.

What is the difference between preemptive and non-preemptive kernels?

a)

Preemptive kernels allow interruption during kernel mode; non-preemptive do not

b)

Non-preemptive kernels are faster

c)

Both allow multiple processes in kernel mode simultaneously

d)

Non-preemptive kernels have race conditions

8.

In the bounded-buffer problem, what must the producer do when the buffer is full?

a)

Continue producing and overwrite old data


b)

Create a new buffer

c)

Wait until a consumer consumes an item

d)

Delete all data in the buffer

9.

When can multiple readers access the shared data simultaneously in the readers-writers problem?

a)

When no writer is writing


b)

When at least one writer is writing

c)

When the buffer is empty

d)

When readers have priority

10.

How can the dining-philosophers problem avoid deadlock?

a)

Allow only 4 philosophers to sit at the table at once


b)

Add more chopsticks

c)

Make philosophers eat one by one

d)

Remove the rice bowl