[Ecls-list] Unbuffered FD stream for stdin/out/err with threads

Matthew Mondor mm_lists at pulsar-zone.net
Mon Mar 15 08:42:09 UTC 2010


On Mon, 15 Mar 2010 09:08:03 +0100
Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> wrote:

> On Mon, Mar 15, 2010 at 5:52 AM, Matthew Mondor <mm_lists at pulsar-zone.net>wrote:
> 
> > Since my local tree keeps using the FILE streams in threaded mode and
> > I've not exprienced any problems (using NetBSD-5), is this related to
> > an OS-specific issue with stdio streams and threads?
> >
> 
> Oh, no, the problem goes beyond that. FILE streams are locking and no two
> threads can operate on the same FILE. Now suppose that thread A is reading
> from stdin using a FILE. Thread B signals an error and enters the debugger.
> It tries to read from stdin but it is locked. What to do?

Is *debug-io* what the debugger uses?  If so, can it use a different
FILE *, even if it's connected to the same underlaying FD as another
stream (if it so happens to be connected to the same "tty")?  As for
user applications trying to read from a common stream using multiple
threads, it would seem to be an application design mistake to me...

Thanks,
-- 
Matt




More information about the ecl-devel mailing list