This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: Thread-safe libio [was Re: BUG in libstdc++ ... libio ... pthreads]
- To: Andreas Gruenbacher <a.gruenbacher@infosys.tuwien.ac.at>
- Subject: Re: Thread-safe libio [was Re: BUG in libstdc++ ... libio ... pthreads]
- From: Ulrich Drepper <drepper@cygnus.com>
- Date: 14 May 1999 06:59:32 -0700
- Cc: libstdc++@sourceware.cygnus.com, Nathan Myers <ncm@best.com>
- References: <199905140714.AAA27568@shell7.ba.best.com> <373BFA68.6E8E0119@infosys.tuwien.ac.at>
- Reply-To: drepper@cygnus.com (Ulrich Drepper)
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 `------------------------