Lock
Noun · Development
Definitions
A synchronization primitive that enforces mutual exclusion — only one thread can hold the lock at a time, and all other threads that attempt to acquire it will block (or spin) until it is released. Common variants include mutexes, read-write locks, and spinlocks.
In plain English: A mechanism that lets only one thread access a shared resource at a time, making others wait their turn to prevent data corruption.
Example: "We wrapped the counter increment in a lock, but now the threads spend more time waiting for the lock than doing actual work."
Related Terms
- Counting Semaphore
- Deadlock Detection
- Double-Checked Locking
- Notify
- Shared State
- Synchronization
- Synchronization Primitive
- Async Context
- Async Lock
- Atomic Counter
- Barrier
- Blocking Queue
- Bounded Channel
- Concurrency Bug
- Concurrency Primitive
- Concurrent Access
- Concurrent Map
- Concurrent Queue
- Concurrent Read
- Concurrent Set