News for hackers. Stuff that matters.
Re:Why should I have written ZeroMQ in C, not C++ by pmahoney on Thursday May 10, 2012 @10:26AM (#3953635)
It is possible for C programs to update themselves with zero downtime. See nginx[1], "Upgrading Executable on the Fly". The trick is that fork()'ed processes (can) inherit open sockets from their parent, even after exec()'ing a new binary. This seems a bit delicate and involves some communication during the hand-off from the old to the new, but it does work. It's also possible to kill the "new" if there were any problems and instruct the "old" to take over again.

This is not to take anything away from Erlang, which is a very interesting system.

[1] http://www.nginx.org/en/docs/control.html

Re:Why should I have written ZeroMQ in C, not C++ by psykotic on Thursday May 10, 2012 @01:13PM (#3954640)
> This seems a bit delicate and involves some communication during the hand-off from the old to the new, but it does work.

MUDs routinely did this back in the day. Here's a README excerpt from Erwin Andreasen's widely used patch:

"Basically, for each playing descriptor, it saves the descriptor number, the player's original name as well as the host name (so we don't have to find that again). Then, it closes fpReserve, and exec's the MUD again. As exec preserves open file descriptors, players do not lose link. The MUD is executed with some extra parameters, so the new copy knows that it should reload some player files. It does that, and puts in the players at their old places."

http://www.andreasen.org/ftp/copyover-7.tar.gz

Re:Why should I have written ZeroMQ in C, not C++ by dataangel on Tuesday May 15, 2012 @11:27AM (#3976987)
Just logged in to say this is the most awesome thing I've read in weeks. Why did I not know this earlier?!