• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/35

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

35 Cards in this Set

  • Front
  • Back

Multiple Choice


1. A race condition ____.


A) results when several threads try to access the same dataconcurrently


B) results when several threads try to access and modify thesame data concurrently


C) will result only if the outcome of execution does not dependon the order in which instructions are executed


D) None of the above

Ans: B


Feedback: 5.2 Difficulty: Medium

2. An instruction that executes atomically ____. A) must consist of only one machine instruction B) executes as a single, uninterruptible unit


C) cannot be used to solve the critical section problem


D) All of the above

Ans: B


Feedback: 5.4 Difficulty: Medium

3. A counting semaphore ____.


A) is essentially an integer variable


B) is accessed through only one standard operation


C) can be modified simultaneously by multiple threads


D) cannot be used to control access to a thread's critical sections

Ans: A


Feedback: 5.6.1 Difficulty: Medium

4. A mutex lock ____.


A) is exactly like a counting semaphore


B) is essentially a boolean variable


C) is not guaranteed to be atomic


D) can be used to eliminate busy waiting

Ans: B


Feedback: 5.5 Difficulty: Difficult

5. In Peterson's solution, the ____ variable indicates if a process is ready to enter its critical section.


A) turn


B) lock


C) flag[i]


D) turn[i]

Ans: C


Feedback: 5.3 Difficulty: Easy

6. The first readers-writers problem ____.


A) requires that, once a writer is ready, that writer performsits write as soon as possible.


B) is not used to test synchronization primitives.


C) requires that no reader will be kept waiting unless a writerhas already obtained permission to use the shared database.


D) requires that no reader will be kept waiting unless a readerhas already obtained permission to use the shared database.

Ans: C


Feedback: 5.7.2 Difficulty: Medium

7. A ___ type presents a set of programmer-defined operations that are provided mutual exclusion within it.


A) transaction


B) signal


C) binary


D) monitor

Ans: D


Feedback: 5.8 Difficulty: Easy

8. ____________ occurs when a higher-priority process needs to access a data structure that is currently being accessed by a lower-priority process.


A) Priority inversion


B) Deadlock


C) A race condition


D) A critical section

Ans: A


Feedback: 5.6.4 Difficulty: Medium

9. What is the correct order of operations for protecting a critical section using mutex locks?


A) release() followed by acquire()


B) acquire() followed by release()


C) wait() followed by signal()


D) signal() followed by wait()

Ans: B


Feedback: 5.5 Difficulty: Easy

10. 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()

Ans: C


Feedback: 5.6 Difficulty: Easy

11. _____ is not a technique forhandling critical sections in operating systems.


A) Nonpreemptive kernels


B) Preemptive kernels


C) Spinlocks


D) Peterson's solution

Ans: D


Feedback: 5.3 Difficulty: Medium

12. A solution to the critical section problem does not have to satisfy which of the following requirements?


A) mutual exclusion


B) progress


C) atomicity


D) bounded waiting

Ans: C


Feedback: 5.2 Difficulty: Medium

13. A(n) _______ refers to where a process is accessing/updating shared data.


A) critical section


B) entry section


C) mutex


D) test-and-set



Ans: A


Feedback: 5.2 Difficulty: Medium

14. _____ can be used to prevent busy waiting when implementing a semaphore.


A) Spinlocks


B) Waiting queues


C) Mutex lock


D) Allowing the wait() operation to succeed

Ans: B


Feedback: 5.6. Difficulty: Easy

15. Assume an adaptive mutex is used for accessing shared data on a Solaris system with multiprocessing capabilities. Which of the following statements is not true?


A) A waiting thread may spin while waiting for the lock to become available.


B) A waiting thread may sleep while waiting for the lock to become available.


C) The adaptive mutex is only used to protect short segments of code.


D) Condition variables and semaphores are never used in place of an adaptive mutex.

Ans: D


Feedback: 5.9.3 Difficulty: Medium

16. What is the purpose of the mutexsemaphore in the implementation of the bounded-buffer problem using semaphores?


A) It indicates the number of emptyslots in the buffer.


B) It indicates the number of occupiedslots in the buffer.


C) It controls access to the sharedbuffer.


D) It ensures mutual exclusion.

Ans: D


Feedback: 5.7.1 Difficulty: Medium

17. How many philosophers may eat simultaneously in the Dining Philosophers problem with 5 philosophers?


A) 1


B) 2


C) 3


D) 5

Ans: B


Feedback: 5.7.3 Difficulty: Medium

18. 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.

Ans: C


Feedback: 5.6 Difficulty: Medium

19. _____ is/are not a technique for managing critical sections in operating systems.


A) Peterson's solution


B) Preemptive kernel


C) Nonpreemptive kernel


D) Semaphores

Ans: A


Feedback: 5.3 Difficulty: Medium

20. When using semaphores, a process invokes the wait() operation before accessing its critical section, followed by the signal() operation upon completion of its critical section. Consider reversing the order of these two operations—first calling signal(), then calling wait(). What would be a possible outcome of this?


A) Starvation is possible.


B) Several processes could be active in their critical sections at the same time.


C) Mutual exclusion is still assured.


D) Deadlock is possible.

Ans: B


Feedback: 5.7 Difficulty: Difficult

21. Which of the following statementsis true?


A) Operations on atomic integers do notrequire locking.


B) Operations on atomic integers dorequire additional locking.


C) Linux only provides the atomic_inc()and atomic_sub()operations.


D) Operations on atomic integers can beinterrupted.

Ans: A


Feedback: 5.9.2 Difficulty: Medium

22. A(n) ___________ is a sequence of read-write operations that are atomic.


A) atomic integer


B) semaphore


C) memory transaction


D) mutex lock

Ans: C


Feedback: 5.10.1 Difficulty: Medium

23. The OpenMP #pragma omp critical directive ___________.


A) behaves much like a mutex lock


B) does not require programmers to identify critical sections


C) does not guarantee prevention of race conditions


D) is similar to functional languages

Ans: A


Feedback: 5.10.2 Difficulty: Medium

24. Another problem related to deadlocks is ____________.


A) race conditions


B) critical sections


C) spinlocks


D) indefinite blocking

Ans: D


Feedback: 5.6.3 Difficulty: Medium

37. Race conditions are prevented by requiring that criticalregions be protected by locks.

Ans: True


Feedback: 5.4 Difficulty: Medium

38. The value of a counting semaphore can range only between 0 and 1.

Ans: False


Feedback: 5.6 Difficulty: Easy

39. A deadlock-free solution eliminates the possibility of starvation.

Ans: False


Feedback: 5.6.3 Difficulty: Medium

40. The local variables of a monitor can be accessed by only the local procedures.

Ans: True


Feedback: 5.8 Difficulty: Medium

41. Every object in Java has associated with it a single lock.

Ans: True


Feedback: 5.8 Difficulty: Medium

42. Monitors are a theoretical concept and are not practiced in modern programming languages

Ans: False


Feedback: 5.8 Difficulty: Easy

43. A thread will immediately acquire a dispatcher lock that is the signaled state.

Ans: True


Feedback: 5.9.1 Difficulty: Easy

44. Mutex locks and counting semaphores are essentially the same thing.

Ans: False


Feedback: 5.6 Difficulty: Easy

Import Settings:45. Mutex locks and binary semaphoresare essentially the same thing.

Ans: True


Feedback: 5.6 Difficulty: Easy

46. A nonpreemptive kernel is safe from race conditions on kernel data structures.

Ans: True


Feedback: 5.2 Difficulty: Medium

47. Linux mostly uses atomic integers to manage race conditions within the kernel.

Ans: False


Feedback: 5.9.2 Difficulty: Medium