Can you freeze a C/C++ process and continue it on a different host?

前端 未结 9 1252
栀梦
栀梦 2021-02-14 02:11

I was wondering if it is possible to generate a \"core\" file, copy if to another machine and then continue execution of the a core file on that machine?

I have seen the

相关标签:
9条回答
  • 2021-02-14 03:07

    I don't believe this is possible. However, you might want to look into virtualization software - e.g. Xen - which make it possible to freeze and move entire system images fromone machine to another.

    0 讨论(0)
  • 2021-02-14 03:09

    On modern systems, not from a core file, no you can't. For freezing and restoring an individual process on Linux, CryoPID and the new Kernel-based checkpoint and restart are in the works, but their abilities are currently quite limited. OpenVZ and other virtualization-like softwares can freeze and restore an entire system.

    0 讨论(0)
  • 2021-02-14 03:11

    This won't, in general, be sufficient to let an arbitrary process continue on another machine. In addition to the heap and stack state, there may also also open I/O handles, allocated hardware resources, etc. etc.

    Your options are either to explicitly write your software in a way that lets it dump state on a signal and later resume from the dumped state, or to run your software in a virtual machine and migrate that to the alternate host - Xen and Vmware both support freeze/restore as well as live migration.

    That said, CryoPID attempts to do precisely this and occasionally succeeds.

    0 讨论(0)
提交回复
热议问题