Locks and Semaphores:

  • Locks are acquired per thread, not per invocation. Semaphores are acquired per invocation.2
  • Locks have a counter that tracks the number of times a thread has acquired the lock. The lock is only released when the counter reaches zero.2
  • Semaphores have an initial value that represents the number of available "permits". Threads must acquire a permit from the semaphore to proceed.4

    All notes