Software Engineering ยท Performance
A synchronization primitive that ensures only one thread can access a shared resource at a time โ others wait until the lock is released.
In practice: Mutexes prevent race conditions on shared state but introduce contention โ threads waiting on a lock can become a bottleneck, and improper usage (acquiring locks in inconsistent order) causes deadlocks.