classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view


Gerd Flaig-2

I noticed some strange behaviour with erl_call (erl_interface versions
3.2 and 3.2.9). When there is more than one instance of erl_call
running concurrently against the same erlang node, there is a rather
high possibility that one of them terminates with an error.

   start() ->
       Pid = spawn_link(test, count, []),
       true = register(counter, Pid).
   count() ->
   count(N) ->
           {incr, Pid} ->
               Pid ! {count, N+1},
           Other ->
               io:format('unknown: ~w~n', [Other])
   incr() ->
       counter ! {incr, self()},
           {count, N} ->
           Other ->
               io:format('unknown: ~w~n', [Other])

im% erl -name test
Erlang (BEAM) emulator version 5.0.2 [source]

Eshell V5.0.2  (abort with ^G)
(test)1> c(test).
(test)2> test:start().

   im% cat
   #! /usr/bin/perl -w
   $erlcall = 'echo \'test:incr().\' | /usr/lib/erlang/lib/erl_interface-3.2.9/bin/erl_call -e -n test';
   $last = 0;
   for(;;) {
     ($n) = `$erlcall` =~ m/{ok,(\d+)}/;
     if($n - $last != 1) {
       print "n: $n, last: $last\n";
     $last = $n;

When I run, I get lots of these:

   <ERROR> erl_connect failed

Any ideas?

        Goodbyte, Gerd.
Gerd Flaig                     Technik                gerd
Bei Schlund + Partner AG       Erbprinzenstr. 4-12  D-76133 Karlsruhe