public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Pétur Runólfsson" <peturr02@ru.is>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: RE: libstdc++/10193: Regression: iostreams no longer threadsafe
Date: Fri, 25 Apr 2003 22:36:00 -0000	[thread overview]
Message-ID: <20030425223600.18913.qmail@sources.redhat.com> (raw)

The following reply was made to PR libstdc++/10193; it has been noted by GNATS.

From: =?iso-8859-1?Q?P=E9tur_Run=F3lfsson?= <peturr02@ru.is>
To: <ljrittle@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	=?iso-8859-1?Q?P=E9tur_Run=F3lfsson?= <peturr02@ru.is>,
	<gcc-gnats@gcc.gnu.org>
Cc:  
Subject: RE: libstdc++/10193: Regression: iostreams no longer threadsafe
Date: Fri, 25 Apr 2003 22:27:05 -0000

 I apologise for taking so long to reply to this.
 
 >     In terms of there being a change in behavior, your=20
 > observation is correct.  However, we consider the new=20
 > behavior to be in line with our published guidelines on=20
 > application requirements to obtain correct thread safety.  In=20
 > sum, all library objects  which are visibly shared across=20
 > threads need to have application-level locking to obtain=20
 > thread safety.
 >     After reading the discussion on this topic in the library=20
 > documentation,
 >     please report your agreement or disagreement with this change.
 
 There seem to be two main points in the documentation that apply
 here:
 
 1) That the application can easily provide locking, so the library
    doesn't need to do so.
 
 2) That adequate locking can't be provided by the library.
 
 I agree with point 1), except for the global objects cout, cerr
 etc. It seems implied that library code that's intended to be
 thread-safe can't touch these objects and that multi-threaded
 programs can't use third-party libraries that may use these
 objects.
 
 Point 2) seems implied by the statement
 >  you might not think of an I/O stream as a container, but
 >  the points made there also hold here.
 I don't agree with this: The most basic reason
 containers can't be made thread-safe is that they return
 references to internal data structures, but I/O operations
 return by value. I also disagree with this because thread-safe
 iostreams implementations exist (most notably gcc-2.95); using
 such an implementation without external locking may be somewhat
 tricky, but is in many cases possible.
 
 Petur


             reply	other threads:[~2003-04-25 22:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-25 22:36 Pétur Runólfsson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-03-24 22:06 ljrittle
2003-03-23 19:46 peturr02

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030425223600.18913.qmail@sources.redhat.com \
    --to=peturr02@ru.is \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).