Mock Quiz Hub
Dark
Mock Quiz Hub
1
Recent Updates
Added: OS Mid 1 Quiz
Added: OS Mid 2 Quiz
Added: OS Lab 1 Quiz
Check back for more updates!
Time: 00:00
Quiz
Navigate through questions using the controls below
0%
Question 1 of 25
Quiz ID: q1
What is the Mutual Exclusion Problem?
Ensuring all processes run simultaneously
Eliminating undesirable interleavings of critical sections
Speeding up process execution
Allowing multiple processes to share resources freely
Question 2 of 25
Quiz ID: q2
What are the two protocols added to solve mutual exclusion?
Pre-protocol and Post-protocol
Start-protocol and End-protocol
Entry-protocol and Exit-protocol
Init-protocol and Term-protocol
Question 3 of 25
Quiz ID: q3
Which property requires that if a process is trying to enter its critical section, it will eventually succeed?
Mutual Exclusion
Deadlock Freedom
No Starvation
Progress
Question 4 of 25
Quiz ID: q4
What is starvation in the context of mutual exclusion?
A process is unable to enter its critical section even though others are
A process terminates unexpectedly
All processes are blocked forever
The system runs out of memory
Question 5 of 25
Quiz ID: q5
In the First Attempt solution, what is the purpose of the variable 'turn'?
To count the number of processes
To indicate which process's turn it is to enter the critical section
To store the process ID
To measure execution time
Question 6 of 25
Quiz ID: q6
Why does the First Attempt solution suffer from starvation in the absence of contention?
Because it uses too many variables
Because if one process halts in its non-critical section, the other may be blocked forever
Because it does not enforce mutual exclusion
Because it causes deadlock
Question 7 of 25
Quiz ID: q7
In the Second Attempt, what does ci == 0 signify?
Process i is in its non-critical section
Process i is in its critical section
Process i wishes to enter its critical section
Process i has terminated
Question 8 of 25
Quiz ID: q8
Why does the Second Attempt fail to ensure mutual exclusion?
Because both processes can check each other's flags simultaneously and both proceed
Because it uses only one variable
Because it does not have a post-protocol
Because it allows deadlock
Question 9 of 25
Quiz ID: q9
In the Third Attempt, where is the assignment ci = 0 placed?
After the critical section
At the beginning of the pre-protocol
Inside the critical section
In the non-critical section
Question 10 of 25
Quiz ID: q10
What problem does the Third Attempt introduce?
Starvation
Deadlock
No mutual exclusion
High overhead
Question 11 of 25
Quiz ID: q11
What is Dekker's Algorithm designed to avoid?
Using any shared variables
Strict alternation and deadlock
All critical sections
Non-critical sections
Question 12 of 25
Quiz ID: q12
In Dekker's Algorithm, what does the variable 'turn' resolve?
Speed of processes
Tie-breaking when both processes want to enter
Memory allocation
Process priority
Question 13 of 25
Quiz ID: q13
What is the key idea behind Dekker's Algorithm?
Processes take turns backing off
Processes never wait
Processes use no shared memory
Processes execute critical sections simultaneously
Question 14 of 25
Quiz ID: q14
Which atomic instructions are assumed in these solutions?
Load and Store
Test-and-Set
Compare-and-Swap
Fetch-and-Add
Question 15 of 25
Quiz ID: q15
What is a critical section?
A section of code that must be executed by all processes
A section of code that accesses shared resources and must not be interleaved
A section of code that is always safe to run concurrently
A section of code that handles errors
Question 16 of 25
Quiz ID: q16
What is the requirement for a process halting in its non-critical section?
It must restart immediately
It must notify other processes
It must not interfere with other processes
It must be terminated by the OS
Question 17 of 25
Quiz ID: q17
What does deadlock mean in mutual exclusion?
A process terminates unexpectedly
No process can enter its critical section even though some are trying
All processes execute their critical sections simultaneously
The system runs out of memory
Question 18 of 25
Quiz ID: q18
What is the minimal overhead requirement in the absence of contention?
A process should immediately enter its critical section
A process should wait indefinitely
A process should check multiple variables
A process should skip its critical section
Question 19 of 25
Quiz ID: q19
In the First Attempt, how is mutual exclusion proven?
By assuming both processes are in the critical section and deriving a contradiction
By testing all possible interleavings
By using mathematical induction
By relying on hardware guarantees
Question 20 of 25
Quiz ID: q20
Why is the First Attempt's proof of no starvation flawed?
Because it does not consider process termination
Because it assumes processes will always set 'turn'
Because it relies on atomic instructions
Because it ignores the critical section
Question 21 of 25
Quiz ID: q21
In the Second Attempt, what interleaving leads to a violation of mutual exclusion?
P1 sets c1=0, then P2 sets c2=0
P1 checks c2, then P2 checks c1, then both set their flags
P1 enters critical section, then P2 enters
P1 sets c1=1, then P2 sets c2=1
Question 22 of 25
Quiz ID: q22
In the Third Attempt, what interleaving causes deadlock?
P1 sets c1=0, then P2 sets c2=0, then each checks the other's flag
P1 sets c1=1, then P2 sets c2=1
P1 checks c2, then P2 checks c1
P1 enters critical section, then P2 enters
Question 23 of 25
Quiz ID: q23
What additional variable does Dekker's Algorithm introduce compared to the First Three Attempts?
A turn variable
A counter
A timer
A priority indicator
Question 24 of 25
Quiz ID: q24
How does Dekker's Algorithm prevent deadlock?
By using a turn variable to allow one process to proceed
By avoiding the use of flags
By allowing both processes to enter
By terminating one process
Question 25 of 25
Quiz ID: q25
What is the overall goal of a mutual exclusion solution?
To allow as many processes as possible into the critical section
To ensure safety (mutual exclusion) and liveness (progress) properties
To minimize the size of the non-critical section
To maximize processor speed
Quiz Summary
Review your answers before submitting
25
Total Questions
0
Answered
25
Remaining
00:00
Time Spent
Submit Quiz
Back to Questions
Previous
Question 1 of 25
Next
!
Confirm Submission
Cancel
Submit Quiz