SitePoint
  • Premium
  • Library
  • Community
  • Jobs
  • Blog
LoginStart Free Trial

The home for developers

Track your course progress, manage projects, and find your dream job - all in one place.

Start Your Free Trial

7 Day Free Trial. Cancel Anytime.

SitePoint Premium

  • Access to 700+ courses
  • Publish articles on SitePoint
  • Daily curated jobs
  • Learning Paths
  • Discounts to dev tools
  • Library/
  • Video courses/
  • Interview Prep: What is a Mutex?
Interview Prep: What is a Mutex?

Interview Prep: What is a Mutex?

Learn about this critical tool for multithreaded programming


Course details

5.0∙1 Rating0 reviews

Published
May 2020
Videos
7
Duration
29m
Happy students
86

Take this course

About the course

Description

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.

Project

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: https://github.com/mortoray/interview.codes

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

Course Instructor

Edaqa Mortoray

Edaqa Mortoray

Hi, I'm Edaqa, a programmer, writer and chef. For over 20 years, I've been following a diverse and exciting career path. My journey traces through several countries, filled with great people and culture. I've dedicated my time to numerous startups, and an abundance of side projects. There's so much I'd like to share with all with you -- from programming to cooking, to the unusual creative endeavours. I want my classes to give you the confidence you need to succeed, and the curiosity required to make the most of life. Join me in my continuing adventures.

Course Outline

Lesson 1: What is Mutex?
  • Free
    Introduction
    1:03
  • Locked
    What does it do?
    4:15
  • Locked
    How does it work?
    8:30
  • Locked
    Waiting with the OS
    3:34
  • Locked
    User and Kernelspace
    5:19
  • Locked
    An experiment with JavaScript
    4:55
  • Locked
    Conclusion
    2:01

Reviews
5.0

1 total

1
0
0
0
0

Course details

5.0∙1 Rating0 reviews

Published
May 2020
Videos
7
Duration
29m
Happy students
86

Take this course
SitePoint

Stuff we do

  • Premium
  • Newsletters
  • Learning paths
  • Library
  • Forums

Contact

  • Contact us
  • FAQ
  • Publish your book
  • Write an article
  • Advertise

About

  • Our Story
  • Corporate Memberships
  • Start free trial
  • Login

Connect

  • RSS
  • Facebook
  • Twitter (X)
  • Instagram

Subscribe to our newsletter

Get the freshest news and resources for developers, designers and digital creators in your inbox each week

© 2000 – 2025 SitePoint Pty. Ltd.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Terms of usePrivacy policy