At Thu, 07 Nov 2019 20:16:29 +0000, Sage Gerard wrote:
> To add: Is it wise to put (begin (sync (system-idle-evt)) (collect-garbage)) 
> in a flush callback on the exit handler's plumber?

I should have clarified that if you need a finalizer to run when Racket
shuts down, then finalization alone is not a good choice. Instead,
`register-finalizer-and-custodian-shutdown` may be the way to go.

A `(begin (sync (system-idle-evt)) (collect-garbage))` is useful when
exploring a potential leak, but it's not reliable for making sure that
everything that could possibly be finalized is finalized. There's just
not a good way to do that with finalizers. But custodians provide
predictable shutdown behavior.

So, adding `(begin (sync (system-idle-evt)) (collect-garbage))` to a
plumber does not seem useful, because the effect is not predictable
enough to rely on.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5dc49878.1c69fb81.78f5f.5692SMTPIN_ADDED_MISSING%40gmr-mx.google.com.

Reply via email to