What's the fastest mechanism in , (I do mean GNU/Linux) and ? I am aware of:
TCP sockets
Domain sockets
Memory sharing


@gudenau what does "fastest" mean? latency? throughput? when under contention, or not?

if latency is your concern, then probably just shared memory segments are going to be the fastest on every platform because they only involve a context switch to set up and then are 100% userspace. if you are frequently setting up and tearing down, though, it may be faster to use a domain socket or a pipe or a fifo than to touch page tables and set up a memory mapping.

as always, gotta know your use case and benchmark

@roguelazer I meant overall bandwidth. I suppose allocating a several GB shared memory buffer would *technically* be the fastest, but that's kinda stupid.

Was just a stray thought.

@roguelazer What would be the best way to sync a shared memory buffer? A read and write size byte or something?

@gudenau o would look at how io_uring in the kernel builds a ring buffer in shared memory; I remember it being quite neat.

Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!