Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
08 Erlang Cont

08 Erlang Cont

Ratings:

4.6

(1)
|Views: 236|Likes:
Published by mberrow
Introduction to Erlang - Part 2 - Carlsson
Introduction to Erlang - Part 2 - Carlsson

More info:

Published by: mberrow on Jun 25, 2007
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

01/01/2013

pdf

text

original

 
An Introduction to Erlang
Part 2 - Concurrency
Richard Carlsson
 
Processes
Whenever an Erlang program is running, thecode is executed by a
 process
The process keeps track of the current programpoint, the values of variables, the call stack, etc.
Each process has a unique
Process Identifier 
 (“Pid”), that can be used to find the process
Processes are
concurrent 
(they run in parallel)
P1
fib(0) -> 1;fib(1) -> 1;fib(N) when N > 0 ->fib(N-1) + fib(N-2).
 
Implementation
Erlang processes are implemented by the virtualmachine, not by operating system threads
Multitasking is preemptive (the virtual machinedoes its own process switching and scheduling)
Processes use very little memory, and switchingbetween processes is very fast
Erlang can handle large numbers of processes
 –
Some applications use more than 100.000 processes
On a multiprocessor machine, Erlang processescan run in parallel on separate CPUs

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->