[erlang-questions] Freezing a process

Torben Hoffmann torben.lehoff@REDACTED
Fri May 28 23:13:17 CEST 2010


On Fri, May 28, 2010 at 20:20, Jeffrey Rennie (レニー) <rennie@REDACTED>wrote:

> I've scoured the manuals unsuccessfully, and I've been unable to
> conjure the right Google query to answer the following question.
> hibernate() seems to get my half way there, but...
>
> Given a pid, can I freeze the process, serialize its stack and heap,
> send it down the wire and effectively resume it on another node?
>
>
Hi Jeffrey.

I cannot give you an answer of how to do it in pure Erlang, but if you are
using OTP you can take the internal state of the component out and send it
to another machine.
Apart from this function to get the state out you will need a start function
that will restore the saved state from the old process.

The OTP framework has the ability to provide takeover functionality for
applicaitons, but if my memory serves me correct it involves a restart and
is in nature more of a resilience feature than a mobility one.

Depending on the details of your requirements there are many subtle things
to consider in this, e.g., who keeps track of where a process with a given
role is located (global could be the answer) and if the resume does not work
how should the behaviour be?
Ask one of the Ericsson guys and you will probably get an almost infinite
list.

The good news is that the tools to get it done is there - the bad news is
that you have to put them together to meet your specific needs (this could
also be good news since it means that there is a job to do!)

Cheers,
Torben
-- 
http://www.linkedin.com/in/torbenhoffmann


More information about the erlang-questions mailing list