3 ms·
I see that you just haven't done it yet. "Allocation" in this context just means open(), mmap(). A "shared memory pool" is a thing I would have no use for. Bu
by ncmncm 7y ago
I see that you just haven't done it yet.
"Allocation" in this context just means open(), mmap(). A "shared memory pool" is a thing I would have no use for.
But I can assure you that you can have excellent, non-trivial parallelism with separate processes and chosen shared memory pages -- much moreso than with threads that must battle one another for access to locks, queues, and "pools". I routinely get order-of-magnitude performance improvement by reorganizing this way.
The single-writer ring buffer is the component that makes it all work. The environment might seem stark, but in exchange you can have exactly 0% concurrency overhead. Not wasting 90% on pool management and thread contention means other optimizations become meaningful. And, you can start and stop the processes independently.