This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: BUG in libstdc++ ... libio ... pthreads


Nathan Myers wrote:
> 
> > The istream input methods seem to contain a bug that causes
> > multithreaded programs to deadlock ...
> > Is this a known problem?
> 
> Yes.  The library is not thread-safe yet.

The problem is, the file lock bug actually makes it thread-defeating 
:-(

What's the benefit of having any file locking code in the library at the
current state?

If you're accessing an I/O class from multiple threads, the only
advantage I see is that the internal data structures of the libio
classes don't get messed up---the output is still interleaved
arbitrarily. In addition, locking/unlocking adds two system calls per
I/O primitive. Since this is expensive, synchronization should at least
be an option to the library user. Do I miss anything?

There is a flag _IO_MTSAFE_IO that determines at library build time
whether or not libio is thread safe. Are there any plans to let the user
decide that at runtime?

Is anybody working on thread safety currently?

-----------------------------------------------------------------------
 Andreas Gruenbacher, Vienna University of Technology
 a.gruenbacher@infosys.tuwien.ac.at
 Contact information: http://www.infosys.tuwien.ac.at/~agruenba


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]