[erlang-questions] C nodes and OTP
Michael Truog
mjtruog@REDACTED
Wed Jan 16 20:09:02 CET 2013
Hi
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 (http://cloudi.org), which provides language integration (including Java) which avoids C nodes.
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.
On 01/16/2013 09:44 AM, Robert Raschke wrote:
>
> Hi David,
>
> 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.
>
> 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.
>
> Alternatively, your C node can use threading to handle messages. That goes beyond my abilities ;-)
>
> Robby
>
> --
> Sent from a mobile device, please excuse the typos.
>
> On Jan 16, 2013 11:03 AM, "David Welton" <davidnwelton@REDACTED <mailto:davidnwelton@REDACTED>> wrote:
>
> Hi
>
> I'm trying to wrap my head around the "best" way to set up an
> OTP-based system that comunicates with a C node.
>
> My inclination so far is to set up a gen_server, and use handle_info/2
> to deal with messages coming from the C node.
>
> Looking at the C node example, it's all about messages, which seems to
> be "the simplest thing that could possibly work", which is good. I'm
> wondering, though, if it makes more sense to try and call directly
> into my gen_server's api with rpc, along the lines of what is being
> done here:
>
> http://stackoverflow.com/questions/4749693/can-i-get-erlang-otp-behaviors-in-c-nodes
>
> Any other tips/tricks/best practices/pitfalls to avoid would be welcome.
>
> Thanks,
> --
> David N. Welton
>
> http://www.welton.it/davidw/
>
> http://www.dedasys.com/
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130116/8914da65/attachment.htm>
More information about the erlang-questions
mailing list