Cover by Francesco Cesarini, Simon Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Behind the Scenes

So, how does the software upgrade feature work behind the scenes? At any one time, two versions of a module may be loaded in the runtime system. We call them the old and the current versions. Before we explain the details of software upgrade, we’ll quickly go over the ways in which functions in one module can refer to functions in another.

  • You might not remember, but function calls of the following format:

    Module:Function(Arg1, .., ArgN)

    where the module name is prefixed to an exported Function name, are usually referred to as fully qualified function calls. This is one of the ways in which a function in one module (A, say) may refer to a function defined in another (let’s call it B).

  • The other mechanism by which module A can refer to functions in module B is for A to import some of the functions of B:

    -import(B, [f/1]).

    Within A it is then possible to refer directly to f, as well as to B:f.

Within a module, it is possible to refer to another function in the same module either directly or by a fully qualified name. We’ll come back to this distinction shortly.

Now we’ll explain the software upgrade process, first for intermodule calls, and then for intramodule calls. Each running process that refers to functions in module A will be linked to a version of module A. When a new version of module A is loaded, that becomes the current version, and the previous current version becomes the old version.

If a process p, defined in module A, calls a function from module B, either ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required