I have several questions. Any input is appreciated. Thank you.
- Do C++ classes survive forking?
- If so, how it is implemented?
- What happens to pointers? Entire free store/heap is replicated and all virtual addresses are preserved?
- What happens to file streams?
Here’s my understanding:
yes.
All of memory is copied so you have no trouble there.
yes.
Both processes retain a copy of all open filestreams. (by default there are some fork options that can change this I think.)
Streams opened after fork are not shared.