auser / stoplight forked from jashmenn/stoplight
- Source
- Commits
- Network (2)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Aug 19 10:11:01 -0700 2009 | |
| |
.gitmodules | Tue Aug 18 13:50:12 -0700 2009 | |
| |
Emakefile | Tue Aug 18 14:00:55 -0700 2009 | |
| |
INSTALL | Mon Aug 17 11:14:30 -0700 2009 | |
| |
README.mkd | Wed Aug 19 13:29:18 -0700 2009 | |
| |
Rakefile | Tue Aug 18 15:42:58 -0700 2009 | |
| |
conf/ | Wed Aug 19 12:17:11 -0700 2009 | |
| |
deps/ | Wed Aug 19 13:20:43 -0700 2009 | |
| |
doc/ | Wed Aug 19 12:18:13 -0700 2009 | |
| |
ebin/ | Tue Aug 18 15:42:58 -0700 2009 | |
| |
include/ | Tue Aug 18 11:43:09 -0700 2009 | |
| |
priv/ | Fri Jul 31 10:30:10 -0700 2009 | |
| |
scripts/ | Wed Aug 19 10:10:35 -0700 2009 | |
| |
src/ | Wed Aug 19 13:20:43 -0700 2009 | |
| |
test/ | Tue Aug 18 14:01:36 -0700 2009 |
README.mkd

Introduction
Stoplight is a distributed mutex server, based on the Sigma algorithm.
Mutual exclusion: No two different clients are in their critical sections at the same time.
Features:
- progress guaranteed in the face of process crashes (i.e. lockout-freedom, will not deadlock)
- assumes asynchronous and unreliable communication
- survives server and client memory loss
- endures messages being lost, duplicated or delivered out of order (non-FIFO)
- mutual exclusion guaranteed if
f<n/3wherefis the number of failed servers andnis the total number of servers.
Install
Prerequisites
- ruby / rubygems / rake
gem sources --add http://gems.github.comgem install auser-skelerl auser-dslify
Build
cd stoplight
rake
Layout
.
|-- EMakefile
|-- INSTALL
|-- README.mkd
|-- deps # dependencies
|-- doc # documentation
|-- ebin # app, bootscripts, ebin files
|-- include # headers
|-- priv
| `-- tasks # rake tasks
|-- scripts # scripts to start/stop stoplight
|-- src # main source
`-- test # tests
Testing Locally
Open three windows:
window 1.
STOPLIGHT_NODENAME="stoplight@your-ip" ./scripts/stoplight-server
window 2.
STOPLIGHT_SERVER="stoplight@your-ip" ./scripts/stoplight-client
1> {Resp, Pid} = stoplight_client:lock(green, 1000).
{crit,<6078.82.0>}
window 3.
STOPLIGHT_SERVER="stoplight@your-ip" ./scripts/stoplight-client
1> {Resp, Lob} = stoplight_client:lock(green).
{no,<6078.91.0>}
back to 2.
2> stoplight_client:release(Pid).
ok
back to 3.
2> {Resp2, Lob2} = stoplight_client:lock(green).
{crit,<6078.91.0>}
Clustering
On Server Machine 1
STOPLIGHT_NODENAME="stoplight@192.168.133.128" ./scripts/stoplight-server
On Server Machine 2
STOPLIGHT_NODENAME="stoplight@192.168.1.66" STOPLIGHT_SERVER="toplight@192.168.133.128" ./scripts/stoplight-server
1> nodes().
['stoplight@192.168.133.128']
On Client Machine
STOPLIGHT_SERVER="stoplight@192.168.133.128" ./scripts/stoplight-client
Configuration
stoplight servers is a valid application configuration option. This means
when starting the server you can specify a list of addresses to other servers
like so:
STOPLIGHT_NODENAME='stoplight@192.168.1.66' STOPLIGHT_SERVER_START_ARGS="-stoplight servers ['stoplight@192.168.133.128']" ./scripts/stoplight-server
Acknowledgements
- Stoplight Icon by alessandro "mentalrey" rei from his KDE "Dark Glass Icon Project" - http://www.mentalrey.it/project.html
