Giant lock
From Wikipedia, the free encyclopedia
In operating systems, giant lock, which is also known as big-lock or kernel-lock, is a lock which may be used to implement a concurrency control in the kernel, which is needed for SMP support.
It is an approach of single, global lock which is held when thread enters the kernel space, for example, after a system call, and released when thread returns to user space. While threads which are in the user space can run concurrently in the processors, only one thread can run in the kernel space, and threads in other processors which are going to enter the kernel space have to wait. This means that giant lock eliminates all concurrency in kernel space.
The main disadvantage of giant lock is that it eliminates the concurrency, thus decrease the performance on multiprocessor systems. However, the advantage of giant lock is that there is no need to modify many parts of the operating systems, thus it is easy to implement. Giant lock approach is mostly used by operating systems to implement an initial support for SMP. As an alternative to giant lock, most of the modern operating systems use fine-grained locking approach.