Skip to content

Instantly share code, notes, and snippets.

@j2labs
Created October 29, 2010 18:21
Show Gist options
  • Save j2labs/654061 to your computer and use it in GitHub Desktop.
Save j2labs/654061 to your computer and use it in GitHub Desktop.
-module(myring).
-export([start/1, start_proc/2]).
start(Num) ->
start_proc(Num, self()).
start_proc(0, Pid) ->
Pid ! ok;
start_proc(Num, Pid) ->
NPid = spawn(?MODULE, start_proc, [Num -1, Pid]),
NPid ! ok,
receive ok ->
ok end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment