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: Thread-safe libio [was Re: BUG in libstdc++ ... libio ... pthreads]


Andreas Gruenbacher <a.gruenbacher@infosys.tuwien.ac.at> writes:

>  a) use flockfile() / funlockfile() to lock the file for each I/O
> operation.
>     Advantage: simple
>     Disadvantage: high overhead

It is no question that this is the method to be used.  Putting the
codlocking code directly in the code is simply unacceptable.  Simply
using a mutex or so without access to the thread library calls for
priority inversion problems.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


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