Filters
Question type

Study Flashcards

Which of the following is not true about compare_and_swap instruction?


A) It is a hardware instruction
B) It is executed atomically
C) Returns the original value of passed parameter
D) Set the new value of passed parameter to "TRUE"
E) Set the variable "value" the value of the passed parameter "new_value" but only if "value" =="expected"

F) A) and E)
G) C) and E)

Correct Answer

verifed

verified

Semaphores and mutex locks both provide mutual exclusion.

A) True
B) False

Correct Answer

verifed

verified

The preemptive kernel may be more responsive than non-preemptive kernel.

A) True
B) False

Correct Answer

verifed

verified

In _________, the process requests permission to access and modify variables shared with others.


A) entry section
B) critical section
C) exit section
D) remainder section

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

Semaphore implementation overcomes the busy waiting problem.

A) True
B) False

Correct Answer

verifed

verified

When mutex lock is implemented as a binary semaphore, what should its value be initialized to be?


A) 0
B) 1
C) -1
D) none of the above

E) B) and C)
F) A) and C)

Correct Answer

verifed

verified

Assume you had a function named update() that updates shared data. Illustrate how a mutex lock named mutex might be used to prevent a race condition in update().

Correct Answer

verifed

verified

void update()
{
mute...

View Answer

Which of the following is true?


A) No deadlock implies no starvation;
B) No starvation implies no deadlock;
C) Deadlock doesn't imply starvation;
D) Starvation implies deadlock.

E) A) and D)
F) All of the above

Correct Answer

verifed

verified

Explain what busy waiting is.

Correct Answer

verifed

verified

While a process is in its critical secti...

View Answer

Which of the following statements is true?


A) A counting semaphore can never be used as a binary semaphore.
B) A binary semaphore can never be used as a counting semaphore.
C) Spinlocks can be used to prevent busy waiting in the implementation of semaphore.
D) Counting semaphores can be used to control access to a resource with a finite number of instances.

E) A) and C)
F) B) and C)

Correct Answer

verifed

verified

Mutex locks and counting semaphores are essentially the same thing.

A) True
B) False

Correct Answer

verifed

verified

In _________, the process may be changing common variables, updating a table, writing a file, and so on.


A) entry section
B) critical section
C) exit section
D) remainder section

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

Which of the following is not true about test_and_set instruction?


A) It is a hardware instruction
B) It is executed atomically
C) Returns the original value of passed parameter
D) Returns the new value of passed parameter
E) Set the new value of passed parameter to "TRUE"

F) C) and D)
G) C) and E)

Correct Answer

verifed

verified

What is the correct order of operations for protecting a critical section using a binary semaphore?


A) release() followed by acquire()
B) acquire() followed by release()
C) wait() followed by signal()
D) signal() followed by wait()

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

What is the difference between semaphore and mutex lock?

Correct Answer

verifed

verified

Semaphores are similar to mutex lock in ...

View Answer

Which of the following regarding mutex lock is NOT true?


A) mutex lock is a hardware solution to critical-section problem
B) mutex lock is a higher-level software solution to critical-section problem
C) mutex lock suffers from busy waiting
D) the general rule of thumb is to use a mutex lock if the lock will be held for a duration less than two context switches

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

Explain two general approaches to handle critical sections in operating systems.

Correct Answer

verifed

verified

Critical sections may use preemptive or ...

View Answer

Under which of the following contention loads does traditional synchronization become faster than CAS-based synchronization?


A) uncontended
B) moderate contention
C) high contention
D) none of the above

E) B) and D)
F) A) and D)

Correct Answer

verifed

verified

Explain what race condition is.

Correct Answer

verifed

verified

A situation where several processes acce...

View Answer

Which of the following is NOT true for Peterson's solution?


A) Mutual exclusion is preserved
B) The progress requirement is satisfied
C) The bounded-waiting requirement is met
D) Peterson's solution works for synchronization among more than two processes

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

Showing 21 - 40 of 61

Related Exams

Show Answer