[erlang-questions] hot-code replacement

Bengt Kleberg <>
Tue Oct 17 09:22:04 CEST 2006


On 2006-10-17 04:43,  wrote:
>> can anyone tell me in detail about the hot-code replacement feature in 
>> erlang and how it works... Also i am a bit confused if this feature is 
>> inherent to erlang or implemented just as a added function..
> 
> I'd like to add on to the question: how do data structure changes interact
> with code replacement? How can you change the definition of a record in a
> module and then cleanly use that, or are code updates just about functions
> definitions?

you only replace functions, but the new functions could be using new 
data structure (ie, record) definitions. see mnesia:transform_table() 
for an aide to handle table updates.

if you are using a gen_server you will have a code_change/3 callback 
that should update loop data.


bengt
-- 
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."



More information about the erlang-questions mailing list