fredyouhanaie / espace

An Erlang Tuple Space implementation
https://fredyouhanaie.github.io/espace
Apache License 2.0
9 stars 1 forks source link

espace

Erlang CI Hex.pm Hex Docs

Introduction

espace is an Erlang implementation of the Tuple Spaces (or Linda) paradigm. Details can be found on Wikipedia for Linda and Tuple Spaces.

Another good source that describes the paradigm well is the following paper:

Carriero, Nicholas & Gelernter, David. (1989). How to Write Parallel Programs: A Guide to the Perplexed. ACM Computing Surveys. 21. 323-357.

A copy of the paper can be obtained from the ACM digital library.

Further details about the application can be found on the wiki pages.

Recent changes

Less recent changes

Current Status

Build and testing

rebar3 is used throughout for all stages of the build and test. All the below commands should be run from the top level directory:

rebar3 as chunks edoc

To try out the application

Using the observer_cli plugin

observer_cli is a command line based (i.e non-GUI) application that can be used to visualise various performance metrics of an erlang node. It can be extended with user supplied plugins, which is what we have here.

The espace plugin, espace_observer.erl, will display a single row for each active instance of espace. Each row will display the instance name, the number of tuples in the TS, the number of waiting (blocked) clients, and the counters for the six operations.

The CUI/TUI can be started with the shell as shown below:

$ rebar3 shell
> espace:start().
> %% start your espace application
> observer_cli:start().

In the observer_cli screen press P<return> to display the espace screen.

You can also run observer_cli as a standalone command, see the notes in the escriptize section.

Before running the observer_cli escript ensure the target node is up and running, e.g.

$ rebar3 shell --name espace@localhost

In a separate terminal window:

observer_cli espace@localhost

Back in the espace shell, try starting a couple of instances:

> espace:start().
> espace:start(aaa).
> espace:out({five, 2+3}).
> espace:eval(aaa, {five, fun () -> 2+3 end})

The above sequence will result in two rows in the observer_cli plugin screen, espace and aaa. Each will show 1 tuple and one out. The aaa instance will also show a count of 1 for eval. Note that each eval op increments the eval and out counts.

Enjoy!

Fred