I'm unfamiliar with Linux. But if I understand it correctly, this would mean the async saver could only access that CoW address space indirectly by some file descriptors, instead of directly accessing the data structures like in the same process. Even if that file descriptor gets mmap-ed, it wouldn't be at the same virtual address, would it?the80srobot wrote: ↑Sun Oct 20, 2024 9:44 pm 3. You now have a file descriptor for the part of the CoW address space and your C runtime is not going to deadlock.
4. Do crazy things to read and your game from the address space snapshot
So for example a pointer resides in such data structures, then you cannot just dereference that pointer since whatever stuff it was pointing at is no longer at the same virtual address. Similarly you can't just call the member functions to do various things, but have to invent specific ways to decode those in-memory representations. It seems to me that this would be too much work if feasible at all.
To say it another way, the best thing about fork is that you can access all your stuff pretending nothing has happened. Except that it's actually a lot trickier.