dynamic code replacement
Ulf Wiger
ulf.wiger@REDACTED
Fri May 14 10:21:03 CEST 1999
Mark NG wrote:
>
> G'day !
>
> I was wondering if there are currently any know problems or issues or gotchas
> with dynamic code replacement under Erlang.
>
> thanks,
> mark
Not really any issues in the sense that it wouldn't work
Dynamic code replacement can be about as easy or complex as you
want/need to make it. The easiest part is simply loading the module. For
library code, this is all that's needed.
Torbjorn Tornkvist wrote:
> Well, in the case where you are running a server. Make sure that
> you make a module prefixed recursive call to the top loop.
> Example:
>
> loop(Data) ->
> receive
> X ->
> NewData = do_stuff(Data,X),
> ?MODULE:loop(NewData)
> end.
If your new version has a different representation of Data, this will
not work. For this eventuality, OTP provides a framework for performing
synchronized code change with hooks for transformation of internal
state.
A couple of pointers:
- If you want to learn about OTP's system messages
http://www.erlang.org/doc/doc/index.html
(Click on "Design Principles")
- If you want to learn about OTP's release handling:
http://www.erlang.org/doc/doc/lib/sasl-1.6.3/doc/index.html
(see the User's Guide.)
/Uffe
--
Ulf Wiger, Chief Designer AXD 301 <ulf.wiger@REDACTED>
Ericsson Telecom AB tfn: +46 8 719 81 95
Varuvägen 9, Älvsjö mob: +46 70 519 81 95
S-126 25 Stockholm, Sweden fax: +46 8 719 43 44
More information about the erlang-questions
mailing list