# pg

### MODULE

pg

### MODULE SUMMARY

Distributed, Named Process Groups

### DESCRIPTION

This (experimental) module implements process groups. A process group is a group of processes that can be accessed by a common name. For example, a group named `foobar` can include a set of processes as members of this group and they can be located on different nodes.

When messages are sent to the named group, all members of the group receive the message. The messages are serialized. If the process `P1` sends the message `M1` to the group, and process `P2` simultaneously sends message `M2`, then all members of the group receive the two messages in the same order. If members of a group terminate, they are automatically removed from the group.

This module is not complete. The module is inspired by the ISIS system and the causal order protocol of the ISIS system should also be implemented. At the moment, all messages are serialized by sending them through a group master process.

### EXPORTS

`create(PgName)`

Creates an empty group named `PgName` on the current node.

`create(PgName, Node)`

Creates an epmty group on the node `Node`.

`join(PgName, Pid)`

Joins the Pid `Pid` to the process group `PgName`.

`send(Pgname, Message)`

Sends the tuple `{pg_message, From, PgName, Message}` to all members of the process group.

`esend(PgName, Mess)`

Sends the tuple `{pg_message, From, PgName, Message}` to all members of the process group, except the current node.

`members(PgName)`

Returns a list of the current members in the process group.

### AUTHORS

Claes Wikstrom - support@erlang.ericsson.se

stdlib 1.13.4
Copyright © 1991-2005 Ericsson AB