<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi<br>
<br>
C nodes have been a non-intrusive way to communicate with Erlang
nodes, and is used in jinterface for JVM communication. So the
main benefit of a C node is decoupling the startup of the C node
code and the Erlang node code. If you don't need the startup
decoupled, I believe an Erlang port is a better choice. If you
want a simpler way of doing C-node-like integration, I have a
project called CloudI (<a class="moz-txt-link-freetext" href="http://cloudi.org">http://cloudi.org</a>), which provides language
integration (including Java) which avoids C nodes.<br>
<br>
The scalability limitation to C nodes is related to the fully
connected network topology that distributed Erlang makes and the
use of the ERL_TICK message (limiting distributed Erlang to 50-100
nodes, unless you get a really fast network.... then perhaps
200). So, avoiding C nodes is also avoiding scalability problems.<br>
<br>
On 01/16/2013 09:44 AM, Robert Raschke wrote:<br>
</div>
<blockquote
cite="mid:CAH+xwdC3ciAUtDOQ_O8zV7qiijSk2ZyHD1Aokr1sRjCHCs2OFg@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<p>Hi David,</p>
<p>one potential pitfall with C nodes in general, regardless of
pure message based or erl_rpc, comes when your C node does
something time consuming. That is, your C node is not responding
to ERL_TICK in a timely fashion. The connected Erlang nodes will
then think that the C node has become disconnected.</p>
<p>It is possible to recognise this situation from within the C
node and explicitly reconnect to an Erlang node. I'm away from
my work just now, but if you want an example, let me know and
I'll send something round tomorrow.</p>
<p>Alternatively, your C node can use threading to handle
messages. That goes beyond my abilities ;-)</p>
<p>Robby</p>
<p>--<br>
Sent from a mobile device, please excuse the typos.<br>
</p>
<div class="gmail_quote">On Jan 16, 2013 11:03 AM, "David Welton"
<<a moz-do-not-send="true"
href="mailto:davidnwelton@gmail.com">davidnwelton@gmail.com</a>>
wrote:<br type="attribution">
<blockquote class="gmail_quote">
Hi<br>
<br>
I'm trying to wrap my head around the "best" way to set up an<br>
OTP-based system that comunicates with a C node.<br>
<br>
My inclination so far is to set up a gen_server, and use
handle_info/2<br>
to deal with messages coming from the C node.<br>
<br>
Looking at the C node example, it's all about messages, which
seems to<br>
be "the simplest thing that could possibly work", which is
good. I'm<br>
wondering, though, if it makes more sense to try and call
directly<br>
into my gen_server's api with rpc, along the lines of what is
being<br>
done here:<br>
<br>
<a moz-do-not-send="true"
href="http://stackoverflow.com/questions/4749693/can-i-get-erlang-otp-behaviors-in-c-nodes"
target="_blank">http://stackoverflow.com/questions/4749693/can-i-get-erlang-otp-behaviors-in-c-nodes</a><br>
<br>
Any other tips/tricks/best practices/pitfalls to avoid would
be welcome.<br>
<br>
Thanks,<br>
--<br>
David N. Welton<br>
<br>
<a moz-do-not-send="true" href="http://www.welton.it/davidw/"
target="_blank">http://www.welton.it/davidw/</a><br>
<br>
<a moz-do-not-send="true" href="http://www.dedasys.com/"
target="_blank">http://www.dedasys.com/</a><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a moz-do-not-send="true"
href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a moz-do-not-send="true"
href="http://erlang.org/mailman/listinfo/erlang-questions"
target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>