An implementation of the Dining Philosophers problem in Erlang
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Dining philosophers - Erlang implementation

This is a sample solution to the Dining Philosophers problem [1] written in Erlang [2]. I picked this up primarily to familiarize myself with Erlang, and because the nature of the problem sounded like a good fit for the language.


conductor.erl provides an implementation based on the conductor solution. 

Improvement suggestions:

 * As far as language goes, could rewrite leveraging gen_server [3] and gen_fsm [4]. Could also break the conductor and philosophers in their own modules for better readability of what the various processes are.

 * Far as the problem itself, writing a Chandy / Misra solution could be a good next setp. From there one should be able to compare efficiency and scalability of both algorithms, and maybe dable with the distributed programming aspects of Erlang.

Thanks, Acknowledgements and License

The folks on Freenode IRC's #erlang channel were most helpful, thanks for the help, suggestions and code reviews guys.

Consider this code public domain, do whatever with it.