Critique of solution to an exercise from the online course

pete-erlang-questions <>
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).
> {next_node,<0.1031.0>}
> 2> length(processes()).
> 24
> 3> ring:start(1000, 10000).
> {next_node,<0.2033.0>}
> 4> length(processes()).
> 1024
> 5> 

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".

Thanks,
Pete




More information about the erlang-questions mailing list