Looking at the web-repl.scm file in gambc/examples, I often see situations of:

lock mutex
write single char
flush output
unlock mutex

Why is this necessary? According to the gambit documentation, ports have to be written to handle concurrent read/writes themselves.

Thanks!