Describe the difference between a mutex and a semaphore. In what scenario would you choose one over the other?