[erlang-questions] The "ei" API and passing *shared* binaries / parts
Karl Nilsson
kjnilsson@REDACTED
Thu Jun 22 18:15:53 CEST 2017
Hi,
I don't know anything about `ei` but we recently wrote an AMQP 1.0 client
in erlang [1]. It isn't 100% complete and is unlikely to provide the kind
of performance you may be expecting given you are looking at the internals
of the runtime itself but it works and it covers the subset of
functionality required for RabbitMQ projects. We have done basic testing
against QPid.
[1] https://github.com/rabbitmq/rabbitmq-amqp1.0-client
Cheers
Karl
On Thu, 22 Jun 2017 at 08:33 Rick van Rein <rick@REDACTED> wrote:
> Hello,
>
> I have looked at the ei module, both documentation and code. It looks
> quite efficient, but I am missing something, and I wonder if it is
> somewhere else.
>
> I started a discussion in the Apache Qpid user forum about integration
> their AMQP 1.0 API with Erlang; there does not seem to be a way of
> getting to AMQP 1.0 from Erlang, and given that both are designed for
> rock-solid software construction that would be a useful marriage. And
> the Go port has a variant API named "electron" that is aimed at
> "synchronous" communication under the assumption of many small processes.
>
> Having to pass a (very) large message into Erlang, and possibly out at
> the other end, requires cloning the entire binary over ei, AFAIK.
> Although Erlang is rumoured to internally use malloc() for binaries,
> with refcounting and parts pointing there (no doubt charging the
> refcount) this functionality (shared memory allocation, sharing parts,
> unsharing) does not seem to be available externally. Nor did I find a
> way of exchanging shared memory and parts over ei. Did I miss it? It
> would improve efficiency in applications where Erlang is on the sending
> or receiving end of AMQP, as well as an intermediate in the pathway.
>
> There is one more use of such an ei facility -- and that is where an
> existing parser in C is asked to decipher a block of text (like SIP,
> XML, ...) or binary (AMQP, DNS, OpenPGP, ...) and return parts thereof
> as components to work on. It's a pitty to have to copy in both
> directions, rather than using an existing malloc() and simply pointing
> into it.
>
> Are such facilities available but have I missed them?
>
> Cheers,
> -Rick
>
> _______________________________________________
> 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/20170622/85b4a0c4/attachment.htm>
More information about the erlang-questions
mailing list