Re: On the implications of adding file-open to SRFI-170
Lassi Kortela 28 Nov 2019 15:20 UTC
> In Gambit, the implementation of “write” (and related procedures) causes characters to be written to the port, and the locking is done at the character level. So indeed separate calls to write in 2 threads may end up interleaving the characters. This is not a bug… for example you may not want individual calls to write to appear atomic if you are debugging the write procedure itself (and the debugging output goes to the same stdout as is being written to by “write”), which may be the case if the programmer has a way to extend the write procedure for specific types and the code in these extensions is buggy. This exists in many Schemes, including Gambit.
Thanks for chiming in. Interesting approach. What's the usual idiom to
write to the same port from more than one thread?