Modules should be versioned. This would provide certain benefits:
the VM can know if it must relink the code when it encounters link instruction, or can skip it
machine would be able to use multiple versions of the code simultaneously
Example without versioned modules: process P1 is in the middle of a function module::a/1, and process P2 requests module module to be relinked. Machine relinks the code. Process P1 calls module::b/1 and crashes because implementation of the module have changed.
Example with versioned modules: process P1 is in the middle of a function module::a/1, and process P2 requests module module to be relinked. Machine relinks the code. Process P1 calls module::b/1, and sends the version of the module along with function signature when requesting entry point. VM supplies entry point for that version. Process P2 calls module::a/1 but uses newer version. Machine supplies entry point for that newer version.
Modules should be versioned. This would provide certain benefits:
link
instruction, or can skip itExample without versioned modules: process
P1
is in the middle of a functionmodule::a/1
, and processP2
requestsmodule
module to be relinked. Machine relinks the code. ProcessP1
callsmodule::b/1
and crashes because implementation of themodule
have changed.Example with versioned modules: process
P1
is in the middle of a functionmodule::a/1
, and processP2
requestsmodule
module to be relinked. Machine relinks the code. ProcessP1
callsmodule::b/1
, and sends the version of the module along with function signature when requesting entry point. VM supplies entry point for that version. ProcessP2
callsmodule::a/1
but uses newer version. Machine supplies entry point for that newer version.