SharedMemory icon indicating copy to clipboard operation
SharedMemory copied to clipboard

Dynamically Growing/Allocatable SharedMemory Buffer (w/ code!)

Open MikeFair opened this issue 9 years ago • 2 comments

Hi all,

I just posted the following Gist as an initial cut on making dynamic shared memory. https://gist.github.com/MikeFair/6908afe26e0b84758ca4

The main idea is that (bufferPosition / blockSize) gives a unique segmentId. "BufferName - [segmentId]" is then the file name of that segment which participants can test for the existence of and load them if they exist. if they do not exist, then participants can create them as they write data into those memory addressses.

There is no signalling happening about new segments; but attempts to read any segments that exist will be dynamically discovered.

Thanks!

MikeFair avatar Feb 09 '16 12:02 MikeFair

Can you explain how can be used?

kasajian avatar Jul 10 '16 05:07 kasajian

I'm interested in this solution too. I need to fast transfer large portions of data of unpredictable volume. I can solve it by means of some intermediate CircularBuffer, but dynamically allocated shared memory looks more attractive. Now it's easier for me to make my own solution with CircularBuffer, because it's hard to study smb. else's code, but if there is more or less working solution, I'd like to try it. Could you please give some examples if any?

quicktrick avatar Apr 14 '17 09:04 quicktrick