Hey all, Attached is a patch to add a "cooperative" REPL server to Guile. This new type of REPL server allows programs that run an event loop (like a game or a simulation) to make use of a REPL server that doesn't present a common pitfall of multithreaded programs: Crashing when 2 threads write to the same resource at the same time. The cooperative REPL ensures that evaluation only happens within the context of a single thread, and the user can control when evaluation is allowed to happen. By cooperative, I mean that the client REPL's are run as coroutines using prompts. All of the REPL's run within the same thread, the thread that calls (spawn-coop-server) and later (poll-coop-server). Reading user input is passed off to another thread and the REPL prompt is aborted. To actually evaluate code, the user must call (poll-coop-server) periodically. Only one REPL can evaluate code at a time. Things seem to be working well. I did basic tests by connecting to the server via telnet and later (when I was confident that I wouldn't crash Emacs) via Geiser. This patch is built on top of Mark Weaver's patch to add the (ice-9 mvars) module. What do you think? - Dave Thompson