Clozure / ccl

Clozure Common Lisp
http://ccl.clozure.com
Apache License 2.0
857 stars 103 forks source link

RFE: output buffer flushing #196

Open msat-cont opened 5 years ago

msat-cont commented 5 years ago

Could we get some automatic output-buffer flushing? When using CCL as a backend at some other systems (e.g. Maxima) I encounter situations where the outputs get quite delayed, like until amounts of output data are there in buffers.

Besides it holds for networked outputs, it is for outputs from external commands too. And actually the command output stuff is the most severe for me by now. An example is using gnuplot as an external command, see: https://sourceforge.net/p/maxima/code/ci/master/tree/src/plot.lisp#l114

I even tried manual output stream flushing (and via a thread too), though to no avail. I do it under Linux, and not sure how it is under other systems. Notice that when using several other Lisp implementations, I get the outputs immediately.

xrme commented 1 month ago

There's a way to ask CCL to flush output automatically on a set of user-specified output streams.

I just added documentation for the relevant functions (add-auto-flush-stream, remove-auto-flush-stream) to https://ccl.clozure.com/docs/ccl.html#auto-flushing-streams.

You said that you tried manually flushing output, though: if that didn't work, I don't expect that auto-flushing will make any difference. Something else must be going on if that's the case.