External-module lifecycle: Psyclone now supervises your own processes

Real-time systems are rarely pure. Alongside your in-process Psyclone modules there is almost always a helper that has to live in its own process — a vendor SDK that insists on owning main(), a Python service, a camera daemon, a licensed binary you cannot link against. Until now, wiring those into a Psyclone node meant writing your own launcher scripts, your own health checks, and your own shutdown sequencing. That glue is where orphaned processes and half-dead nodes come from.

Psyclone 2.1.1 makes external processes a first-class part of the spec. Declare an external-module executable and Psyclone owns its whole lifecycle: it starts the process when the node comes up, supervises it while it runs, and stops it gracefully before the node itself goes down.

Crash isolation, not crash propagation

The point of running a module out-of-process is containment: if it dies, it should not take the system with it. Psyclone now delivers on that directly — a crashed internal space is automatically restarted, so a fault in one component becomes a brief local outage instead of a node-wide failure. Combined with the external-executable supervision, you get a clear blast radius around anything you do not fully trust.

Shutdown that actually shuts down

Graceful teardown is the part everyone gets wrong, and it took real work to get right across three platforms. Helper processes are now notified that their space is shutting down before the node stops, giving them a chance to close cleanly inside the stop timeout rather than being killed mid-write.

Two platform-specific hazards were fixed along the way. On Windows, a child created with CREATE_NEW_CONSOLE cannot receive the parent’s console control event, so helpers now handle CTRL_BREAK, CTRL_C and CTRL_CLOSE and exit when their space is torn down. And Node::terminate could previously end up calling EndProcess on its own PID — a self-inflicted SIGKILL during shutdown — which is now impossible.

Underneath, CMSDK gained NewProcessEx, ReadProcessOutput and SendProcessBreak: cross-platform child-process spawn, output capture and graceful-break signalling, available to your own code as well as to Psyclone’s lifecycle manager.

The result is one lifecycle story for in-process and out-of-process modules alike — fewer bespoke wrapper scripts, no orphaned processes, and a supervision model you declare rather than implement.

Full detail is in the Psyclone AIOS documentation and the 2.1.1 release announcement.

Similar Posts

Leave a Reply