logoalt Hacker News

cestith • yesterday at 4:44 PM • 1 reply • view on HN

I have a book from years ago about writing an OS, and the example OS used in it, MMURTL, used message passing heavily but IIRC not exactly the actor model. It allowed one to swap out parts of the OS the same way, though. One could spin up a new copy and have new messages go to the new version while the old cleared its queue. You could choose to stop processing the queue in the old one and let the messages queue up to let the new one start processing the input queue once the old messages were drained.

https://bookfinder.com/search/?isbn=9780672306556

The core of the actor model is that an actor can interact with the rest of the system in three ways, not just two. It can receive messages, send messages, or spin up a new actor.


Replies

cowlevel • yesterday at 7:46 PM

I think usually for hot code replacement of a stateful service, you want to freeze the incoming queue, run a state update procedure, and then resume processing of incoming messages by the new code. For a stateless service the strategy you described can work.