I abandoned IPCsockets in favor of shared memory. I don't need to do copies. I just allocate a shared memory ptr of adequate size, and all processes (master and slaves) operate on this common ptr. I send the name of the share memory block to the slave processes via IPCsocket so the slaves can retrieve the ptr addresses when master allocates.
Works very well, and allows me to break the 4GB allocation limit because of the inability of RS to build 64 bits. The only thing you need to watch for is program crashes: because this memory lives outside the app's heap, it is not automatically cleaned up, and this will lead to nasty leaks that persist even after your program quits/crashes. there is a simple solution tho. hope this helps, P. On Wed, Nov 16, 2011 at 11:24 AM, Michael Diehr <[email protected]> wrote: > I'm considering using FileMapping with Shared Memory to speed up some IPC > sockets. However, if I'm understanding the documentation... > > On the server side, the memoryblock returned by FileMappingView.create > can't be set to an existing memoryblock (thus, requiring a copy operation) > > On the client side, the "The memoryblock has no known size" - does this > mean you can't use it for operations such as MemoryblockRGBAtoPictureMBS? > and thus a 2nd copy of the memoryblock would need to be made? > > My worry is that if there are two extra copy operations (one on server > end, one on client end) that the shared memory may not be any faster than > IPC sockets. > > Thoughts? > > _______________________________________________ > Mbsplugins_monkeybreadsoftware.info mailing list > [email protected] > > https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info > -- --------------------------------------------- Peter K. Stys, MD Dept. of Clinical Neurosciences Hotchkiss Brain Institute University of Calgary tel (403) 210-8646 --------------------------------------------- _______________________________________________ Mbsplugins_monkeybreadsoftware.info mailing list [email protected] https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
