Skip to main content
← Lab

Semaphore P / V operations / SEMAPHORE

Learn
中文 ↗

INTERACTIVE SYSTEMS LAB / 01

Acquire · wait

Turn two abstract letters into visible state changes.

PS = S − 1

Decrement first. If the new value < 0, block the caller.

P(S) {
  S--;
  if (S < 0) block();
}
Buttons · Keys · Wheel · Swipe01 / 29