What is the difference between a mutex and a semaphore?

3 stars If you are short on time, start with this one.

In one or two sentences
A mutex lets one thread at a time into a critical section. A semaphore is a counter that lets in a set number at a time.

Think of your own answer first

Say it out loud, or type it below. What you type never leaves this device.

Follow-up questions

These are likely next questions from an interviewer. Think of your answer first, then press the button.

  1. 1 / 3

    What is a critical section?

Sources checked