4

オープン ソース プロジェクトの '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

この機能に関するユーザーガイドによると、そのような制限はありません。バグですか?

4

1 に答える 1

6

ここで確認できるように、外部 pid で list_to_pid/1 を使用することはできません。

Google で調べてみると、Ulf Wiger によって開始された元のスレッドも見つかると思います。

お役に立てれば!

于 2012-05-07T10:48:18.910 に答える