What Does Lock Mean?

A lock is a mechanism used to synchronize different processing threads, with set limits to avoid unlimited accessibility of a certain resource within a computing environment. It is a method meant to arrange access by applying simultaneous control policies.


Locks are typically advisory, which means that a thread works collaboratively with other threads to acquire the lock before it is given accessibility to the data it queries. Mandatory locks are also applied by some systems, where an exception occurs as a result of unauthorized access to a source in a locked status.

Also known as locking.

Techopedia Explains Lock

A lock has a simple form called a semaphore, where there is no solid difference between a shared, read only mode and an exclusive read/write mode. Shared mode has many forms including exclusive, intend-to-exclude and intend-to-upgrade. These forms are implemented in many computing systems.

There is also another method of classifying locks, which depends on the lock technique used to avoid accessing the unintended thread. A common locking technique blocks the execution of a thread entirely until the thread acquires the lock, while a spinlock tells the thread to freeze access attempts until it acquires the lock.


Related Terms

Margaret Rouse
Technology Expert

Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.