3 ms·
> shared memory lets you share data structures between processes In theory maybe. In practice data structures contain pointers, which you can't just shove into
by the8472 10y ago
> shared memory lets you share data structures between processes
In theory maybe. In practice data structures contain pointers, which you can't just shove into cross-process shared memory. Which in turn results in copying things and serialization/deserialization overhead when doing IPC.
With multi-threading you can just share regular data structures (think std::map) and put them under locks or copy-on-write logic if they need to be modified.
Of course you can share some large blobs, like pixel data or loaded files. But the major data churn consisting of many small, nested data structures involves copying and (de)serializing.