Critique of solution to an exercise from the online course
Fri Aug 5 03:05:29 CEST 2005
On Wed, Aug 03, 2005 at 06:15:12PM -0400, wrote:
> Aside from comments and suggestions, I'd also appreciate any ideas why
> my processes aren't exiting correctly. Things work for a while but
> then things fall apart on me.
> :~/work/src/erlang$ erl
> Erlang (BEAM) emulator version 5.4.6 [source] [threads:0]
> Eshell V5.4.6 (abort with ^G)
> 1> ring:start(1000, 100).
> 2> length(processes()).
> 3> ring:start(1000, 10000).
> 4> length(processes()).
I figured out why my processes were not "exiting". It just turned out
that they hadn't finished running. Doh! I should have left the print
statement when the head of the ring received the token back and exited.
I'd still be interested in any feedback on the code as I'd like to make
sure I'm doing things the "right way".
More information about the erlang-questions