3 ms·
multiprocessing relies on the OS' fork() to share the memory transparently to the child(ren). The pages containing the memory will refer back to the same physic
by wyldfire 5y ago
multiprocessing relies on the OS' fork() to share the memory transparently to the child(ren). The pages containing the memory will refer back to the same physical page until they're written to. This is what grandparent meant by "sharing memory".
multiprocessing also provides a way to access the OS' explicit shared memory usually used as an IPC mechanism.
- uniqueuid 5y agoRight, thanks for clearing that up. multiprocessing's "shared memory" facility is for writable memory. What I described is extremely handy as you simply move the parsing code up in the script, before your function definition, and "magically" gain memory efficiency.