list转换为pid函数list_to_pid/1限制

Che*_* Yu 4 erlang

当测试开源项目'gproc'函数时,我发现list_to_pid对于本地pid是好的,而对于远程pid则不行.我的erlang运行时是R15B.

(dist_test_n2@yus-iMac.local)29> D = list_to_pid("<0.239.0>").
<0.239.0>
(dist_test_n2@yus-iMac.local)30> D == self(). %% equal here
true
(dist_test_n2@yus-iMac.local)31> f(E).
ok
(dist_test_n2@yus-iMac.local)32> E = gproc:where(Name).       
<8969.239.0>
(dist_test_n2@yus-iMac.local)33> F = list_to_pid("<8969.239.0>").
<8969.239.0>
(dist_test_n2@yus-iMac.local)34> F == E. %% not equal here
false
Run Code Online (Sandbox Code Playgroud)

从用户指南有关此功能,没有这样的限制.是bug吗?

Vin*_*gio 6

你可以在这里确认,不可能将list_to_pid/1与外部pid一起使用.

如果你检查谷歌我认为你也可以找到由Ulf Wiger发起的原始线程.

希望这可以帮助!