[nanomsg] Re: Language binding vs custom network protocol implementation

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx, "Jason E. Aten" <j.e.aten@xxxxxxxxx>
  • Date: Thu, 18 Sep 2014 09:18:38 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15/09/14 10:05, Matthew Hall wrote:
> Ah... I didn't realize upon first reading it would let you alloc
> your own custom one. However it requires making an entire
> proprietary transport.
> 
> It would be much nicer if I could push them through the standard 
> transports, and just get a destroy callback when the transport
> completes or gives up, upon where I return it to the HugeTLB pool.
> Making a whole new transport just to tweak zero-copy behavior is
> very heavy handed then I'd add all my own bugs to my custom
> transport that didn't exist in the original nanomsg code.

Zero-copy requires custom allocators.

Example 1:

Transporting a message via shared memory - the message must be
explicitly allocated in shmem. Malloc or any other equivalent would
not work, you would have to copy the message to the other process's
memory, i.e. it would not be zero-copy.

Example 2:

RDMA - the message must be allocated in a physical memory, so that
RDMA hardware can read the message directly from the memory,
circumventing the CPU.

If, on the other hand, you just want to use custom allocator, just
overload malloc/free functions as jemalloc, tcmalloc et c. do.

Martin

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJUGodIAAoJENTpVjxCNN9YKS8H/jU7Vc3OP9852z3kroAiaGPM
u7tumn2V/fWINTBspd/y0Fdf52tFfvAXqJs078N/vUItyGO9tH4TeAO0kiNkRLup
acbQfQmQy8eTvmoXWxziHWk82mi8qLC7YyFwgMxx8YJAzPCrKyq9+L8tbJw//8sF
QjfZQACKjAeeI9WZaatAaxHWZFbDxatwGpGua7oHahHfV5Qh2kzux/pSRT4S9wvZ
9nn6Tv92Xms7P1SBakitc9vlEBH2VrSDrn8dXkMbXTuVUFLN4iS1Rrb2VVQ4ZX7S
b+PGi4cCOhMYw10Nnjec3mzD8TIx4h4KAyzXmyolwdVfJCvvAI3mhzuG+61/eSg=
=zU2S
-----END PGP SIGNATURE-----

Other related posts: