[erlang-questions] The "ei" API and passing *shared* binaries / parts
Thu Jun 22 18:15:53 CEST 2017
I don't know anything about `ei` but we recently wrote an AMQP 1.0 client
in erlang . 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
On Thu, 22 Jun 2017 at 08:33 Rick van Rein <rick@REDACTED> wrote:
> 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?
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions