erlang code update, possible in C/C++?
Sebastian Strollo
seb@REDACTED
Wed Nov 6 01:54:51 CET 2002
Enric Jaen <enricjaen@REDACTED> writes:
> I am very interested in the Erlang code update
> capability. AFAIK from documents, Erlang uses dynamic
> linking to point processes to the new version of the
> module when they do a global call. The old and new
> versions can run concurrently.
Well it isn't really the type of dynamic linking that your typical
ld.so does - it is implemented as part of Erlangs run-time system.
> I am wondering if this same mechanism can be used with
> C/C++ programs, using dynamic libraries. If not, why?
I guess one could build a similar framework - but right off the bat
you can't. For one thing you would get name clashes if you tried to
load an object file with the same symbols as an object file you
already had loaded (you would have to give the symbols version numbers
or something). And you couldn't just have the threads (assuming you
have threads) themselves jump to the new code, it would have to be
synchronized somehow (pretty much like the code change in the OTP
framework I guess). Major headache to implement I would say...
> and therefore, what is the added value than Erlang
> provides and that C/C++ don't have to update code?
The premise for this feature is that in a long running system you want
to be able to update code without taking down the system. I guess the
major difference is that in Erlang you have that mechanism built into
the language "for free" - in C/C++ (on any OS I know at least) you
don't.
/Sebastian
More information about the erlang-questions
mailing list