2 Overview

Note: Erlang uses a peculiar terminology in respect to threads. In Erlang parlance, threads are called ``processes''. This terminology is due to a couple of reasons. First, the Erlang runtime environment is a virtual machine. Second, because Erlang is a functional language, no state is shared among its threads. Since the concurrent tasks in an Erlang system run as top-level peers within a single [virtual] machine and don't share state, they are therefore named ``Processes''.

To avoid confusion when using this document alongside the Erlang documentation, the remainder of this document uses the word ``process'' instead of ``thread''. You are free, however, to pronounce the word ``process'' however you wish.

This package provides an implementation of the following Erlang core functions:

These 4 functions form the core of Erlang's concurrency services. The spawn() function creates a new process, the send() function sends a message to another process, the receive statement specifies what to do with received messages, and the link() function allows one process to monitor the status of another process. In addition to these core functions, this package also provides implementations of several supplemental functions such as spawn_link() and exit().

The beauty of the Erlang system is that it is simple and yet powerful. To communicate with another process, you simply send a message to it. You do not need to worry about locks, semaphores, mutexes, etc. to share information among concurrent tasks. Developers mostly use message passing only to implement the producer/consumer model. When you combine message passing with the flexibility of the receive statement, however, it becomes much more powerful. For example, by using timeouts and receive patterns, a process may easily handle its messages as a state machine, or as a priority queue.

For those who wish to become more familiar with Erlang, Concurrent Programming in Erlang provides a very complete introduction. In particular, this package implements all of the functions described in chapter 5 and sections 7.2, 7.3, and 7.5 of that book.

SourceForge.net Logo