Back to Developer Roadmap

Mutex

src/data/roadmaps/ruby/content/mutex@toevE0eM7c5f_zeSaVjdr.md

4.0379 B
Original Source

Mutex

A mutex (mutual exclusion) is a synchronization primitive that provides exclusive access to a shared resource. It essentially acts as a lock, ensuring that only one thread or process can access a critical section of code at any given time. This prevents race conditions and data corruption that can occur when multiple threads try to modify the same data simultaneously.