Question 11
EasyWhich requirement of a critical-section solution says that a process should not have to wait forever to enter its critical section?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operating Systems
Which requirement of a critical-section solution says that a process should not have to wait forever to enter its critical section?
Mutual exclusion
Atomicity
Progress
Bounded waiting
Sign up free to see the answer and a step-by-step explanation.
What is the entry section of a process's code?
The code that asks for permission to enter the critical section
The code that prints output
The code that frees memory
The first line of the program
Sign up free to see the answer and a step-by-step explanation.
In the producer–consumer problem, what must the consumer do when the buffer is empty?
Create an item itself
Stop the producer permanently
Wait until the producer adds an item
Delete the buffer
Sign up free to see the answer and a step-by-step explanation.
In the producer–consumer problem, what must the producer do when the buffer is full?
Make the buffer larger
Wait until the consumer removes an item
Overwrite the oldest item
Stop forever
Sign up free to see the answer and a step-by-step explanation.
What is an atomic operation?
An operation done by the user
An operation that uses nuclear power
An operation that completes as one indivisible step, without interruption
An operation on very small numbers
Sign up free to see the answer and a step-by-step explanation.
What does signal() (also called V) do to a semaphore?
Sets it to zero
Increases its value and may wake a waiting process
Decreases its value
Deletes it
Sign up free to see the answer and a step-by-step explanation.
A process calls wait() (P) on a semaphore whose value is 0. What happens?
Nothing happens
The process is terminated
The process blocks until another process signals the semaphore
The semaphore becomes −1 and the process continues
Sign up free to see the answer and a step-by-step explanation.
What is a condition variable used for inside a monitor?
Counting the number of monitors
Speeding up the CPU
Storing the result of a calculation
Letting a thread wait until some condition becomes true
Sign up free to see the answer and a step-by-step explanation.
What is lock contention?
A lock that cannot be opened
A broken password
A lock on a file that has been deleted
Several threads trying to acquire the same lock at the same time
Sign up free to see the answer and a step-by-step explanation.
Why must a shared variable be protected when several threads update it?
Unprotected updates can interleave and give wrong results (a race condition)
Threads cannot read shared variables
To make the program use less memory
Shared variables are always read-only
Sign up free to see the answer and a step-by-step explanation.