Now is just as good a time as any to mention that I always reach for "sqlite" by default when writing code for others and I've never had a wiggle of a performance issue due to that aspect of communication.
Soma
Now is just as good a time as any to mention that I always reach for "sqlite" by default when writing code for others and I've never had a wiggle of a performance issue due to that aspect of communication.
Soma
If the different processes are considered to be all logically part of the same program (i.e. the fact that there are multiple processes is an "implementation detail"), and the modules are always built together and deployed together, then I would share structures directly, at will. This is especially the case if the processes are direct fork()'s of each other -- share away!
If the processes are more like clients/servers, peers, SOA entry points, or otherwise, then I would transport data with extreme paranoia (as if they could all potentially be implemented with alien technology).
EDIT: Obviously there are serious issues if the shared data contains pointers which are actually dereferenced.
Last edited by brewbuck; 04-13-2012 at 01:04 PM.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
I don't think it'll matter in this case;
as the file I'll be mapping to virtual memory will already contain the data (which will be mutable, to an extent, by one of the processes).
So, the alien tech paranoia would have to exist, as the data could be created by an alien.
I'm trying to reduce that to the point that there would be no issues.
It wouldn't.EDIT: Obviously there are serious issues if the shared data contains pointers which are actually dereferenced.
You might also want to look into Boost.Interprocess. Not only does it provide nice C++ abstractions around shared memory, it also has some container classes that you can place into such memory.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law