| Author |
Message |
< Erlang ~ erlang:process_info doesn't seem to work across meshed nodes |
| ptmoy |
Posted: Tue Mar 15, 2011 7:40 pm |
|
|
|
User
Joined: 24 Dec 2009
Posts: 10
Location: New Jersey, U.S.A.
|
I'm using the test program (test2) shown below. I created a meshed cluster consisting of two nodes (node a & node b - please see below). From node a, I spawned a child process, which waits in a loop to receive messages; I also created a group via pg2, and made the spawned child process a member of this group. I used the "getPid" function from the test program to get the Pid of the only member of the group (i.e., pid of the spawned child process). As you can see below, I can send a message via the Pid (located in node a) from node b as expected. But when I tried to run erlang:process_info on this same pid on the two nodes, it works on node a but not on node b. What am I doing wrong? Also, when I run "getPid" from node b, I always get an exception the first time (see below), then it'll work after that - why is this?
Any help would be appreciated. Thank in advance.
-module(test2).
-export([init/0, getPid/0, receiver/0]).
init()->
pg2:create(t2group),
Pid = spawn (test2, receiver, []),
pg2:join (t2group, Pid).
getPid()->
[MemberPid] = pg2:get_members(t2group),
MemberPid.
receiver() ->
receive
Info ->
io:format ("Received: ~p~n", [Info]),
receiver()
end.
pm@T110:~/projects/test2$ erl -sname a
Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.8.2 (abort with ^G)
(a@T110)1> test2:init().
ok
(a@T110)2> Pid = test2:getPid().
<0.44.0>
Received: "message"
(a@T110)3> erlang:process_info (Pid).
[{current_function,{test2,receiver,0}},
{initial_call,{test2,receiver,0}},
{status,waiting},
{message_queue_len,0},
{messages,[]},
{links,[]},
{dictionary,[]},
{trap_exit,false},
{error_handler,error_handler},
{priority,normal},
{group_leader,<0.31.0>},
{total_heap_size,233},
{heap_size,233},
{stack_size,1},
{reductions,16},
{garbage_collection,[{min_bin_vheap_size,46368},
{min_heap_size,233},
{fullsweep_after,65535},
{minor_gcs,0}]},
{suspending,[]}]
(a@T110)4>
pm@T110:~/projects/test2$ erl -sname b
Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.8.2 (abort with ^G)
(b@T110)1> net_adm:ping(a@T110).
pong
(b@T110)2> Pid = test2:getPid().
** exception error: no match of right hand side value
{error,{no_such_group,t2group}}
in function test2:getPid/0
(b@T110)3> Pid = test2:getPid().
<5916.44.0>
(b@T110)4> Pid ! "message".
"message"
(b@T110)5> erlang:process_info (Pid).
** exception error: bad argument
in function process_info/1
called as process_info(<5916.44.0>)
(b@T110)6> |
|
|
| Back to top |
|
| NedFrank |
Posted: Wed Dec 21, 2011 3:10 pm |
|
|
|
Joined: 21 Dec 2011
Posts: 7
Location: Kansas
|
Merging like this can create some major headaches. I've been trying to find a way to get some large files into a email database using Outlook. Nothing. We need a manual for this stuff!
_______________________
IT guy for several years, StoredIQ may solve your fears! |
|
|
| Back to top |
|
| dongdongwu |
Posted: Thu Sep 20, 2012 5:55 am |
|
|
|
User
Joined: 19 Sep 2012
Posts: 236
|
His good friend Diane said: "Christian Louboutin Men Shoes was a magician, he make shoes is immediately put his female people with legs and advantage. He understands women wanted to do and can make them into beautiful Cinderella." Madonna often in its concert wearing Christian louboutin high heels , and some famous superstar like Angelina jolie, mariah Carey, beyonce Knowles, the famous Japanese singer YaYouMei Hamasaki helps Christian Louboutin Men Shoes set up its powerful position. The youngest customers will count Tom cruise's daughter sully cruz. Louboutin made for only a pair of handmade Christian Louboutin high heel Shoes! Want to be more fashion? Put on Christian Louboutin Outlet !
Candy colors of the chalaza high-heeled shoes with lolita type allure, set full finely gem blue "neon shoes" is to need to use "sexy" to describe. Each pair are worth careful appreciation of lithe and graceful fairy ludaoli, what kind of most let you move?Christian Louboutin Men Shoes that one brush red is always cannot resist the temptation, Christian Louboutin men outlet continue to use the days of high 8cm above slender heel proclaim the sexy and luxuriant. The bowknot on black pointed high-heeled shoes with sharp rivet concomitant, wild python met enchanting color printing grain, It is that pairs of high-heeled shoes lets Carrie more feminine flavour. Like Christian Louboutin for men her word. |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|