Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Monitor (synchronization)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Object or module in concurrent programming}} {{howto|date=January 2014}} In [[concurrent computing|concurrent programming]], a '''monitor''' is a synchronization construct that prevents threads from concurrently accessing a shared object's state and allows them to wait for the state to change. They provide a mechanism for threads to temporarily give up exclusive access in order to wait for some condition to be met, before regaining exclusive access and resuming their task. A monitor consists of a [[lock (computer science)|mutex (lock)]] and at least one '''condition variable'''. A '''condition variable''' is explicitly 'signalled' when the object's state is modified, temporarily passing the mutex to another thread 'waiting' on the '''condition variable'''. Another definition of '''monitor''' is a '''thread-safe''' [[class (computer science)|class]], [[object (computer science)|object]], or [[module (programming)|module]] that wraps around a [[mutual exclusion|mutex]] in order to safely allow access to a method or variable by more than one [[thread (computer science)|thread]]. The defining characteristic of a monitor is that its methods are executed with [[mutual exclusion]]: At each point in time, at most one thread may be executing any of its [[method (computer science)|methods]]. By using one or more condition variables it can also provide the ability for threads to wait on a certain condition (thus using the above definition of a "monitor"). For the rest of this article, this sense of "monitor" will be referred to as a "thread-safe object/class/module". Monitors were invented by [[Per Brinch Hansen]]<ref name=":0">{{Cite book|title = Operating System Principles|last = Brinch Hansen|first = Per|publisher = Prentice Hall|year = 1973|isbn = 978-0-13-637843-3|chapter = 7.2 Class Concept|chapter-url = http://brinch-hansen.net/papers/1973b.pdf|url-access = registration|url = https://archive.org/details/operatingsystemp0000brin}}</ref> and [[C. A. R. Hoare]],<ref name=":1">{{cite journal |last1=Hoare |first1=C. A. R. |author1-link=Tony Hoare |title=Monitors: an operating system structuring concept |journal=[[Communications of the ACM|Comm. ACM]] |volume=17 |issue=10 |date=October 1974 |pages=549β557 |doi=10.1145/355620.361161 |citeseerx=10.1.1.24.6394 |s2cid=1005769 }}</ref> and were first implemented in [[Per Brinch Hansen|Brinch Hansen's]] [[Concurrent Pascal]] language.<ref>{{cite journal |last1=Hansen |first1=P. B. |author1-link=Per Brinch Hansen |title=The programming language Concurrent Pascal |journal=[[IEEE Transactions on Software Engineering|IEEE Trans. Softw. Eng.]] |volume=SE-1 |issue=2 |date=June 1975 |pages=199β207 |doi=10.1109/TSE.1975.6312840 |s2cid=2000388 |url=https://authors.library.caltech.edu/34677/1/06312840.pdf }}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)