[plt-scheme] capturing output from different threads
At Sat, 08 Mar 2008 19:08:25 +0000, Dave Griffiths wrote:
> One thing I've just noticed is that the output from the thread in that
> example doesn't actually come through the outport - with this slightly
> modified example, where I've prepended the output with "!!!" - any
> ideas?:
I'm pretty sure that output does go through outport. If I comment out
the C printf(), there's no output.
The thread will generate output much faster than it is extracted from
the port. Maybe you're seeing a "!!!" followed by thousands of lines of
"hello\n", so that the "!!!" is lost in the sea of output?
Also, scheme_get_sized_byte_string_output() doesn't remove the output
from the port, so you're getting cumulative output every time.
Matthew