Machine-translated by Google. Questions are authored in English.
Top

Discussion

The operations on a semaphore are conventionally named

  • A.lock and unlock, which are the mutex operations
  • B.send and receive, which are the queue operations
  • C.wait and signal, or take and give
  • D.open and close, as for a file

Answer: C

Correct answer: wait and signal, or take and give

Dijkstra’s original names were P and V, from the Dutch, and modern kernels use wait and signal or take and give. Whatever they are called the pair does the same thing: one decrements the count and blocks if it cannot, the other increments it and releases a waiter.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.