I feel like this must be a FAQ. I have a server process that I’m starting with process*, and I’d like to try to make sure that it gets killed when the “program halts.” (Presumably, this corresponds to process end at the command-line, or (more relevant to me) a click on “Run” in DrR, which AFAIK means “custodian-shutdown-all” on the user’s program’s custodian.
The manual says this: "The values managed by a custodian are only weakly held by the custodian. As a result, a will can be executed for a value that is managed by a custodian.” If I’m understanding this correctly, this tells me that what I’m looking for can be done, but suggests to me that it’s guaranteed to happen only if the thread that is waiting to execute the will is running outside the custodian. To test this, I tried this program: #lang racket (define an-executor (make-will-executor)) (void (thread (λ () (let loop () (will-execute an-executor) (loop))))) (define (executor-proc v) (printf "will got executed.\n")) (struct Foo (a b)) (define my-foo (Foo 3 4)) (will-register an-executor my-foo executor-proc) (sleep 1.0) (printf "shutting down now.\n”) As expected, running this at the command line does not generate the output “will got executed”, suggesting to me that if printf is like (control-proc ‘kill), the server won’t get shut down. I suspect that if I were to carefully read Revenge of the Son of the Lisp machine, I would understand this more clearly. Before I do that (or fail to do that), is there a simple way to achieve what I believe I want? Many thanks in advance. RTFM’s gratefully accepted. John -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.