NEW
Font size
WorksheetsChapter 4_IPC_Synchronization
Total questions: 10
Worksheet time: 5mins
What is the main purpose of process synchronization?
To execute all processes at the same time
To avoid deadlock in the system
To coordinate processes accessing shared resources
To speed up CPU execution
What is a race condition?
When two processes compete for CPU time
When multiple processes access shared data and the final result depends on which finishes last
When processes execute one after another
When a process runs faster than expected
What is the critical-section problem?
A problem caused by too many threads
A situation where processes need to access shared data one at a time
An issue caused by faulty synchronization hardware
A memory management problem
Which of the following is not a requirement for solving the critical-section problem?
Mutual exclusion
Progress
Infinite waiting
Bounded waiting
What does a process do when it enters a critical section using a lock?
It acquires exclusive access to a shared variable
It releases all resources
It pauses until the next process arrives
It waits for user input
In the TestAndSet mechanism, what happens if the lock is already set (locked)?
The process continues into the critical section
The process must wait until the lock is released
The process deletes the lock variable
The process resets the system
What is the difference between preemptive and non-preemptive kernels?
Preemptive kernels allow interruption during kernel mode; non-preemptive do not
Non-preemptive kernels are faster
Both allow multiple processes in kernel mode simultaneously
Non-preemptive kernels have race conditions
In the bounded-buffer problem, what must the producer do when the buffer is full?
Continue producing and overwrite old data
Create a new buffer
Wait until a consumer consumes an item
Delete all data in the buffer
When can multiple readers access the shared data simultaneously in the readers-writers problem?
When no writer is writing
When at least one writer is writing
When the buffer is empty
When readers have priority
How can the dining-philosophers problem avoid deadlock?
Allow only 4 philosophers to sit at the table at once
Add more chopsticks
Make philosophers eat one by one
Remove the rice bowl
