列表转换为pid函数list_to_pid / 1限制 [英] list convert to pid function list_to_pid/1 restriction

查看:215
本文介绍了列表转换为pid函数list_to_pid / 1限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

从用户指南了解此功能,没有这样的限制。是bug吗

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

推荐答案

可以确认这里不可能使用list_to_pid / 1与外部的pids。

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

如果你检查谷歌我想你也可以找到原来线程由Ulf Wiger开始。

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

希望这有帮助!

这篇关于列表转换为pid函数list_to_pid / 1限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆