
Lab Quiz on Semaphores and Banker's Algorithm
Authored by Dr. Chaudhuri
Other
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of using semaphores in the Producer-Consumer problem?
To improve program speed
To print buffer contents
To synchronize access to shared resources
To increase buffer size
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which type of semaphore ensures only one thread accesses the critical section at a time?
Counting Semaphore
Binary Semaphore / Mutex
Shared Semaphore
Deadlock Semaphore
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the given C program, which condition checks if the buffer is full?
in == out
(in+1)%bufsize == out
buffer[in] == buffer[out]
in > out
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the wait(empty); operation represent in the Producer-Consumer problem?
Waiting for buffer to become full
Waiting for buffer to become empty
Waiting for an empty slot to produce
Waiting for a signal to exit
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of the Banker's Algorithm?
CPU scheduling
Memory allocation
Deadlock avoidance
Disk scheduling
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not required for Banker's Algorithm?
Maximum demand of each process
Resources allocated to each process
Priority of each process
Total number of available resources
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Banker's Algorithm, a system is said to be in a safe state if:
All processes can finish in some order
No deadlock occurs
There are enough resources for all processes
Processes are blocked
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?