On Jul 6, 2:36 pm, Archos <
raul....@sent.com> wrote:
> But the usual approach could be to build a tree of dependencies, and
> then upgrade all of those atomically. Or it might just go the simple
> route by not allowing any types to change between upgrades.
>
> In Java, you have the OSGi project [1] and hotswap [2], which
> facilitates upgrading and changing modules of your application without
> touching other modules.
It's also interesting the technique used by the Nginx web server to
emulate it:
1. Use the spawn family of system calls (ex. spawnl spawnvp) with the
flag P_NOWAIT to execute itself. This new process has access to the
open sockets.
2. The new process should open a predetermined file containing the
file descriptors of the sockets it needs to use saved by the old
process.
3. Start calling “accept” on the same listening sockets that the old
process was accepting.
4. Signal the old process to stop accepting, and to quit when all
requests are finished.
http://www.codexon.com/posts/hot-code-swapping-for-servers-not-written-in-erlang