On Mon, 25 Sep 2017 19:59:39 +0100 Chris Vine <vine35792...@gmail.com> wrote: > ... you could consider launching the new process in C code via the > guile FFI so you can ensure that no non-async-signal-safe code is > called at the wrong time; but presumably you would still have by some > means to prevent the garbage collector from being able to start a > memory reclaiming run in the new process after the fork and before the > exec, and again I do not know how you would do that. You would also > need to block system asyncs before forking (and unblock after the fork > in the original process) but that is trivial to do.
On reflection I don't think there is an issue with the garbage collector if you adopted this approach. After forking there is only one thread running in the new process - the thread of execution of the forking thread - and provided that the new process does not attempt to allocate memory after the fork and before the exec, I doubt the garbage collector has a way in which it can be provoked to begin trying to reclaim memory in the new process.