Skip to content

Instantly share code, notes, and snippets.

@onlyshk
Created October 14, 2011 14:59
Show Gist options
  • Select an option

  • Save onlyshk/1287355 to your computer and use it in GitHub Desktop.

Select an option

Save onlyshk/1287355 to your computer and use it in GitHub Desktop.
start(Pid) ->
register(my_process, spawn(module, loop, [Pid])).
loop(Pid) ->
receive
{From, give_pid} ->
From ! Pid
end,
loop(Pid).
@onlyshk

onlyshk commented Oct 14, 2011

Copy link
Copy Markdown
Author

my_process ! {self, give_pid},
receive
Pid ->
что то делаем с pid
_ ->
error

@burinov

burinov commented Oct 14, 2011

Copy link
Copy Markdown

spawn(pid_holder, start, [Pid])

@onlyshk

onlyshk commented Oct 14, 2011

Copy link
Copy Markdown
Author

From ! {pid, Pid}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment