将整个进程状态存储在磁盘上并稍后恢复? (在 Linux/Unix 上)
我想知道:是否有系统调用、库、内核模块或命令行工具可以用来在磁盘上存储正在运行的程序的完整状态?
也就是说:我想将进程当前使用的内存、页面布局、堆栈、寄存器、线程和文件描述符完全转储到硬盘驱动器上的文件中,并能够在以后无缝地恢复它,就像模拟器“savestate”一样”或虚拟机“快照”。
如果可能的话,我还希望拥有程序状态的多个“备份副本”,这样如果程序由于某种原因终止,我可以恢复到以前的执行点。
这可能吗?
I would like to know: Is there a system call, library, kernel module or command line tool I can use to store the complete state of a running program on the disk?
That is: I would like to completely dump the memory, page layout, stack, registers, threads and file descriptors a process is currently using to a file on the hard drive and be able to restore it later seamlessly, just like an emulator "savestate" or a Virtual Machine "snapshot".
I would also like, if possible, to have multiple "backup copies" of the program state, so I can revert to a previous execution point if the program dies for some reason.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该查看伯克利实验室的 BLCR 项目。
这被多个 MPI 实现广泛使用,以提供
并行应用程序的检查点/重新启动功能。
You should take a look at the BLCR project from Berkeley Lab.
This is widely used by several MPI implementations to provide
Checkpoint / Restart capabilities for parallel applications.
核心转储基本上就是这样,所以是的,它一定是可以获得的。
您真正想要的是一种将转储重新存储为正在运行的程序的方法。那可能会更困难。
A core dump is basically this, so yes, it must be possible to get.
What you really want is a way to restore that dump as a running program. That might be more difficult.