Content deleted Content added
No edit summary |
m →Concurrency and distribution orientation: link to Light-weight process |
||
Line 274:
|quote=Erlang is conceptually similar to the occam programming language, though it recasts the ideas of CSP in a functional framework and uses asynchronous message passing.
|doi-access=free
}}</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}}</ref>
|