Interview Prep: What is a Mutex?

5.0 Average Customer Rating

Learn about this critical tool for multithreaded programming

  • 7 Videos
  • 0 hours 29 minutes
  • 79 Happy Students

About the course


You’ve used a mutex before, but have you wondered how it works? In this class, we look inside to discover what lock and unlock do. We’ll discuss how a program coordinates with the operating system, to allow multiple threads to synchronize their work.

Aside from satisfying your curiosity, this knowledge improves your understanding of concurrent processing. Anybody working with parallel computing should know what’s happening. It helps you spot defects, unravel performance problems, and avoid the evil data races.

I might gloss over a few details in the class, but at the end you’ll understand how a mutex works.


How would you like to write a mutex?

That may sound harder than it really is. I’ve created a small app, with some skeleton interface for the mutex. You need to complete the mutex to get the simulation working correctly.

This exercise helps you internalize a part of how the mutex works.

The code is at:

Check it out and open the `demo.html` file in your browser. You need to complete the `mutex.js` file.

  • 7 Videos
  • 0 hours 29 minutes
  • 79 Happy Students

Courses Outline

Lesson 1: What is Mutex?
What does it do?
How does it work?
Waiting with the OS
User and Kernelspace
An experiment with JavaScript
  • 7 Videos
  • 0 hours 29 minutes
  • 79 Happy Students