[erlang-questions] replace inet_dist TCP in favour of Tilera UDN for speed

Motiejus Jakštys desired.mta@REDACTED
Fri Oct 19 22:50:12 CEST 2012


Hi again,

TLDR: I can plug my own Erlang distribution mechanism just by creating
an OTP application. No need to patch Erlang. Awesome!

On Fri, Oct 19, 2012 at 05:42:38PM +0200, Patrik Nyblom wrote:
> There is an example in $ERL_TOP/lib/kernel/examples/uds_dist, with a
> driver that implements just enough to run distribution ofer Unix
> domain sockets. Maybe that will be of help?

This example is exactly what I needed. After some poking around I found
this invaluable resource: http://erlang.org/doc/apps/erts/alt_dist.html

It is more than I could have expected.

> >2. Do I correctly imply that running a heterogeneous Erlang cluster (for
> >    instance, inet_tcp_dist and inet6_tcp_dist) is not possible?
> Yes it is - if the naming is done so that you can differentiate
> between names of the two different types when connecting. The select
> function in uds_dist.erl implements a crude version of this.

This is more than perfect :-) I can load the UDN driver only on Tilera,
and do something like this in my port driver:

    select(Node) ->
        %% Some code that defines whether "the Node node is on the same
        %% Tilera machine. Naive version:
        lists:prefix("tile_", list_to_atom(Node)).

And my cluster is heterogeneous (some UDN, some TCP). Yay!

Praises to this part of OTP internals design. It is shining.

P.S. I have a suspicion that I will be the first person doing
cross-compilation using rebar. :-)

Regards,
Motiejus



More information about the erlang-questions mailing list