Semaphores 1 - Operating System Questions and Answers

  • 1. An un-interruptible unit is known as :
   A.) static
   B.) single
   C.) atomic
   D.) none of these

Answer: Option 'C'

atomic

  • 2. The TestAndSet instruction is executed :
   A.) after a particular process
   B.) periodically
   C.) atomically
   D.) none of these

Answer: Option 'C'

atomically

  • 3. Semaphore is a/an _______ to solve the critical section problem.
   A.) hardware for a system
   B.) special program for a system
   C.) integer variable
   D.) none of these

Answer: Option 'C'

integer variable

  • 4. The two atomic operations permissible on semaphores are :
   A.) wait
   B.) stop
   C.) hold
   D.) none of these

Answer: Option 'A'

wait

  • 5. Spinlocks are :
   A.) CPU cycles wasting locks over critical sections of programs
   B.) Locks that avoid time wastage in context switches
   C.) Locks that work better on multiprocessor systems
   D.) All of these

Answer: Option 'D'

All of these

  • 6. The main disadvantage of spinlocks is that :
   A.) they are not sufficient for many process
   B.) they require busy waiting
   C.) they are unreliable sometimes
   D.) they are too complex for programmers

Answer: Option 'B'

they require busy waiting

  • 7. The wait operation of the semaphore basically works on the basic _______ system call.
   A.) stop()
   B.) block()
   C.) hold()
   D.) wait()

Answer: Option 'B'

block()

  • 8. The signal operation of the semaphore basically works on the basic _______ system call.
   A.) continue()
   B.) wakeup()
   C.) getup()
   D.) start()

Answer: Option 'B'

wakeup()

  • 9. If the semaphore value is negative :
   A.) its magnitude is the number of processes waiting on that semaphore
   B.) it is invalid
   C.) no operation can be further performed on it until the signal operation is performed on it
   D.) none of these

Answer: Option 'A'

its magnitude is the number of processes waiting on that semaphore

  • 10. The code that changes the value of the semaphore is :
   A.) remainder section code
   B.) non – critical section code
   C.) critical section code
   D.) none of these

Answer: Option 'C'

critical section code

Semaphores 1 - Operating System Questions and Answers Download Pdf