Misplaced Pages

Giant lock: Difference between revisions

Article snapshot taken from[REDACTED] with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 00:18, 28 July 2009 editDanielPharos (talk | contribs)Extended confirmed users8,679 editsm Removed wrong category← Previous edit Revision as of 03:15, 3 September 2009 edit undoTasukete (talk | contribs)3 edits Reworded for grammar and clarity. Still not quite happy with the third paragraph, though...Next edit →
Line 1: Line 1:
In ], '''giant lock''', which is also known as '''big-lock''' or '''kernel-lock''', is a ] which may be used to implement a ] in the kernel, which is needed for ] support. In ], a '''giant lock''', also known as a '''big-lock''' or '''kernel-lock''', is a ] which may be used in the ] to provide the ] required by ] (SMP) systems.


It is an approach of single, global lock which is held when a ] enters the ], for example, after a ], and released when the thread returns to ]. While threads which are in the ] can run concurrently in the ], 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 ] in kernel space. A giant lock is a solitary global lock that is held whenever a ] enters ], and is released when the thread returns to ] (a ] is the archetypal example). In this model, threads in ] can run concurrently on any available ] or ], but no more than one thread can run in kernel space; any other threads that try to enter kernel space are forced to wait. In other words, the giant lock eliminates all ] in kernel space.


The main disadvantage of giant lock is that it eliminates the concurrency, thus decrease the performance on ] 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 ] approach. By isolating the kernel from concurrency, many parts of the kernel no longer need to be modified to support SMP. By the same token, performance is predictably inefficient on SMP systems. Accordingly, the giant lock approach is commonly seen as a preliminary means of bringing SMP support to an operating system, yielding benefits only in user space. Most modern operating systems use a ] approach.


==See also== ==See also==

Revision as of 03:15, 3 September 2009

In operating systems, a giant lock, also known as a big-lock or kernel-lock, is a lock which may be used in the kernel to provide the concurrency control required by symmetric multiprocessing (SMP) systems.

A giant lock is a solitary global lock that is held whenever a thread enters kernel space, and is released when the thread returns to user space (a system call is the archetypal example). In this model, threads in user space can run concurrently on any available processors or processor cores, but no more than one thread can run in kernel space; any other threads that try to enter kernel space are forced to wait. In other words, the giant lock eliminates all concurrency in kernel space.

By isolating the kernel from concurrency, many parts of the kernel no longer need to be modified to support SMP. By the same token, performance is predictably inefficient on SMP systems. Accordingly, the giant lock approach is commonly seen as a preliminary means of bringing SMP support to an operating system, yielding benefits only in user space. Most modern operating systems use a fine-grained locking approach.

See also

Category:
Giant lock: Difference between revisions Add topic