I am looking for a way to restart a thread, either from within the context of the thread or from outside the thread, possibly from another process. (Any of these options will work.) I am aware of the difficulty of hibernation in all processes, and I am sure that the same difficulties are associated with threads. However, I still ask you to hope that someone has an understanding.
My goal is to pause, save to a file and restart the current stream from its exact context without any changes in this stream code or, rather, changes only in a small area - that is, I cannot write serialization functions in the entire code. The main block of code must be unmodified and will not have any global / system descriptors (file descriptors, sockets, mutexes, etc.). Really not requiring data storage, such as CPU registers, is not necessary; but basically the heap, stack and program counter should be saved, and everything else is necessary for the flow to execute logically from the save point. The resulting state of the program should not differ if it was saved or not.
This is for a debugging program for highly reliable software; the goal is to run software simulations with various input scripts and be able to pause the current simulation and then restart it again later - or force the sim to a branch point, save it, make many copies, and then run further the simulation from the general starting point. That is why the main program cannot be changed.
The main language of the stream is in C ++ and should work on Windows and Linux, however, if there is a way to do this on only one system, then this is also acceptable.
Thanks in advance.
Malderi
source
share