[erlang-questions] Passing a digraph between processes on the same node

Steve Davis <>
Wed Jun 10 01:55:45 CEST 2015


Hi,

Somehow I’m not seeing why the following fails:

-module(gtest).
 
-export([test/0]).
 
test() ->
                Test = self(),
                spawn(fun() -> graph(Test) end),
                receive
                {ok, G} ->
                                digraph:vertices(G)
                after 5000 ->
                                timeout
                end.
 
graph(Pid) ->
                G = digraph:new(),
                digraph:add_vertex(G),
                Pid ! {ok, G}.

…since the backing ets table is “protected" by default, shouldn’t the calling process be able to read the values set by the process that builds the digraph?

(It’s probably trivial and me being dumb).

ty for your time,

/s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150609/0900dde3/attachment.html>


More information about the erlang-questions mailing list