Erlang (programming language): Difference between revisions

Content deleted Content added
Mismatched quotes Processes
Rescuing 3 sources and tagging 0 as dead.) #IABot (v2.0.9.3) (Whoop whoop pull up - 12943
Line 276:
}}</ref> Processes are the primary means to structure an Erlang application. They are neither [[operating system]] [[Process (computing)|processes]] nor [[Thread (computing)|threads]], but [[Light-weight process|lightweight processes]] that are scheduled by BEAM. Like operating system processes (but unlike operating system threads), they share no state with each other. The estimated minimal overhead for each is 300 [[Word (computer architecture)|words]].<ref>{{cite web |title=Erlang Efficiency Guide – Processes |url=http://www.erlang.org/doc/efficiency_guide/processes.html|archive-url=https://web.archive.org/web/20150227174813/http://www.erlang.org/doc/efficiency_guide/processes.html|archive-date=27 February 2015}}</ref> Thus, many processes can be created without degrading performance. In 2005, a benchmark with 20 million processes was successfully performed with 64-bit Erlang on a machine with 16 GB [[random-access memory]] (RAM; total 800 bytes/process).<ref>{{cite web |first=Ulf |last=Wiger |title=Stress-testing erlang |url=https://groups.google.com/group/comp.lang.functional/msg/33b7a62afb727a4f?dmode=source |work=comp.lang.functional.misc |access-date=25 August 2006 |date=14 November 2005}}</ref> Erlang has supported [[symmetric multiprocessing]] since release R11B of May 2006.
 
While [[Thread (computing)|threads]] need external library support in most languages, Erlang provides language-level features to create and manage processes with the goal of simplifying concurrent programming. Though all concurrency is explicit in Erlang, processes communicate using [[message passing]] instead of shared variables, which removes the need for explicit [[Lock (computer science)|locks]] (a locking scheme is still used internally by the VM).<ref>{{cite web |title=Lock-free message queue |url=http://erlang.2086793.n4.nabble.com/Lock-free-message-queue-td2550221.html |access-date=23 December 2013 |archive-date=24 December 2013 |archive-url=https://web.archive.org/web/20131224104549/http://erlang.2086793.n4.nabble.com/Lock-free-message-queue-td2550221.html |url-status=dead }}</ref>
 
[[Inter-process communication]] works via a [[shared-nothing architecture|shared-nothing]] [[asynchronous method dispatch|asynchronous]] [[message passing]] system: every process has a "mailbox", a [[queue (data structure)|queue]] of messages that have been sent by other processes and not yet consumed. A process uses the <code>receive</code> primitive to retrieve messages that match desired patterns. A message-handling routine tests messages in turn against each pattern, until one of them matches. When the message is consumed and removed from the mailbox the process resumes execution. A message may comprise any Erlang structure, including primitives (integers, floats, characters, atoms), tuples, lists, and functions.
Line 394:
==Further reading==
{{Refbegin}}
* {{Cite thesis |first=Joe |last=Armstrong |title=Making reliable distributed systems in the presence of software errors |url=https://www.sics.se/~joe/thesis/armstrong_thesis_2003.pdf |type=PhD |publisher=The Royal Institute of Technology, Stockholm, Sweden |year=2003 |access-date=13 February 2016 |url-status=dead |archive-url=https://web.archive.org/web/20150323001245/https://www.sics.se/~joe/thesis/armstrong_thesis_2003.pdf |archive-date=23 March 2015 }}
* {{cite book |doi=10.1145/1238844.1238850 |isbn=978-1-59593-766-7 |title=Proceedings of the third ACM SIGPLAN conference on History of programming languages – HOPL III |year=2007 |chapter=A history of Erlang |last=Armstrong |first=Joe |pages=6–1|s2cid=555765 }}
* [http://www.erlang.se/publications/bjarnelic.pdf Early history of Erlang] {{Webarchive|url=https://web.archive.org/web/20190829000127/http://www.erlang.se/publications/bjarnelic.pdf |date=29 August 2019 }} by Bjarne Däcker
*{{cite journal |last1=Mattsson |first1=H. |last2=Nilsson |first2=H. |last3=Wikstrom |first3=C. |year=1999 |title=Mnesia – A distributed robust DBMS for telecommunications applications |journal=First International Workshop on Practical Aspects of Declarative Languages (PADL '99) |pages=152–163}}
* {{cite book
Line 416:
|archive-url=https://web.archive.org/web/20120306002430/http://www.erlang.org/erlang_book_toc.html
|archive-date=6 March 2012
}}
* {{cite book
|first=Joe
Line 442:
|isbn=978-0-596-51818-9
|url=http://www.erlangprogramming.org
}}
* {{cite book
|first1=Martin
Line 467:
|url=http://www.ibm.com/developerworks/opensource/library/os-erlang1/index.html
|access-date=10 May 2011
}}
* {{cite web
|last=Martin
Line 476:
|date=17 May 2011
|url=http://www.ibm.com/developerworks/opensource/library/os-erlang2/index.html
|access-date=17 May 2011
}}
* {{cite web
|last=Wiger
Line 486 ⟶ 487:
|url=http://www.erlang.se/publications/Ulf_Wiger.pdf
|access-date=16 September 2014
|archive-date=19 August 2019
}}
|archive-url=https://web.archive.org/web/20190819130310/http://www.erlang.se/publications/Ulf_Wiger.pdf
|url-status=dead
}}
{{Refend}}