IRC channel logs

2021-09-16.log

back to list of logs

<iskarian>Is there a way to ensure that (format #t ...) output isn't interleaved when using e.g. par-for-each?
<flatwhatson>iskarian: (define (thread-safe-format . args) (monitor (apply format args)))
<flatwhatson>monitor is a macro which creates a unique mutex to protect that critical section
<iskarian>flatwhatson, thanks, though that would require rewriting all calls to 'format', yes? is there perhaps a way to just automatically redirect all calls to 'format'?
<iskarian>Or alternatively there's a way to replace the current-output-port with a custom port such that writes can't be interleaved? (The unit I care about is single format calls--it's not expected for there to be more than one format call per "message")
<flatwhatson>using a custom port might work, though there's no guarantee that one format call will be one write
<flatwhatson>(it might be, i'm not sure)
<iskarian>flatwhatson, as you suspected, this did not work: https://paste.debian.net/1211944
***chris is now known as Guest7352
<dsmith-work>Morning Greetings, Guilers
<stis>Greetings guilers!