list convert to pid function list_to_pid/1 restriction

笑着哭i 提交于 2019-12-22 09:06:00

问题


When test open source project 'gproc' function, I found list_to_pid is ok for local pid, and not ok for remote pid. My erlang runtime is 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

From user guide about this function, there is no such restriction. Is it bug?


回答1:


as you can confirm here it's not possible to use list_to_pid/1 with external pids.

If you check on google I think you can also find the original thread started by Ulf Wiger.

Hope this helps!



来源:https://stackoverflow.com/questions/10475321/list-convert-to-pid-function-list-to-pid-1-restriction

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!