public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* New STL implementation from SGI
@ 1998-07-02  7:08 Peter Simons
  1998-07-06  4:08 ` Jeffrey A Law
  0 siblings, 1 reply; 38+ messages in thread
From: Peter Simons @ 1998-07-02  7:08 UTC (permalink / raw)
  To: egcs

-----BEGIN PGP SIGNED MESSAGE-----

I just checked the latest STL release from SGI and was pleased to see
that auto_ptr and a few other things have been fixed/added. I notice,
though, that the latest egcs snapshot (obtained via CVS today) does
still have the old STL implementation. Are there any plans to upgrade
to the new STL before the next release?

	-peter

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1

iQCVAwUBNZuT9g9HL1s0103BAQF25AP+PFM/C4QDrcTca5IxcXCEYWu0k1GP3yqM
a2gMdrWyrhs97AkA0aaAZjOWTIcAmZ5guaItlxyPYCwHdAF3FBzmKWIPwBWyngSp
KYGtk7uwluH5KaZCxCiO5ICM47W6oX732S8fwEoNuhrZYi9ARFZxVBeL1xvXyy82
WTTQuXv+/wM=
=jnE4
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 38+ messages in thread
[parent not found: <x7sokk1h55.fsf.cygnus.egcs@peti.gmd.de>]
* Re: New STL implementation from SGI
@ 1998-07-07 22:54 Josh Stern
  0 siblings, 0 replies; 38+ messages in thread
From: Josh Stern @ 1998-07-07 22:54 UTC (permalink / raw)
  To: carlo, martin; +Cc: egcs

If the new STL is not obviously incompatible/broken when used
with egcs 1.1, how about making the choice of which STL is built
and installed a configure option?  The extra src would only
be a small percentage of the total package.  The configure could
also bump the minor version number on libstdc++.

- Josh

jstern@citilink.com

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: New STL implementation from SGI
@ 1998-07-11  6:31 Josh Stern
  0 siblings, 0 replies; 38+ messages in thread
From: Josh Stern @ 1998-07-11  6:31 UTC (permalink / raw)
  To: jbuck, pnagel; +Cc: egcs

>> I'm all for including different implementations of the string class. 
>> How about renaming basic_string to shallow_copy_basic_string and  
>> deep_copy_basic_string respectively, and then have a mechanism to 
>> choose which one is typedefed to basic_string - thereby allowing one 
>> to write code that uses *both*? 
                                     
>Ah, but there is a *third* implementation possibility: you could base  
>your string class on the SGI "rope" class, which gives you yet another 
>performance tradeoff.  I supposed you could call the rope implementation 
>"lots_of_pieces_string".

>Since the standard says there is just basic_string, any chosen mechanism   
>would have to compile standard programs and not pollute the namespace.  
>If you just do a #define, it is easy -- but the user has to use the same   
>#define for everything in the program.  If there is a controllable   
>typedef, 

The idea of user control is good.

>you could do different definitions in different compilation 
>units as long as you don't pass strings between units.  

If I was working on a multi-user project, I'd be scared of the
confusion resulting from such a restriction (I'd like to name
the classes different things that could turn out to be typedef'd
to the same implementation).  But the idea
of using different versions to address implementation tradeoffs comes
up over and over.  For instance, with the STL map/set/multimap etc.
classes there is a tradeoff between, on the one hand, best
small project speed and readability with a pure template solution,
and on the other hand, best space efficiency with a solution that
maps different template classes to common code based on
manipulation of void* pointers (I don't know whether
that runs into problems with exceptions, but the idea is clear).

One idea to consider is distributing a directory of c++contrib code
that #ifdef'd typedefs in user code could access based on the 
macro-defined compiler name and version number.  That should
make it easy to work around portability issues.


- Josh



^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: New STL implementation from SGI
@ 1998-07-13  1:48 Ross Smith
  1998-07-13  8:40 ` Thomas Kunert
  0 siblings, 1 reply; 38+ messages in thread
From: Ross Smith @ 1998-07-13  1:48 UTC (permalink / raw)
  To: egcs

From: Joe Buck <jbuck@synopsys.com>
>
>> Ouch! I've been happily using strings to pass around megabyte-sized
>> blobs of data, but reading about the SGI string class makes me want
>> to run and reread the spec to check on how portable my use is - I
>> thought C++ strings were *supposed* to have reference countng
>> semantics.
>
>This shows why Stepanov's (inventor of STL) notion of specifying
>performance guarantees for library algorithms in standards is so
>important.  Unfortunately this was only done for the STL part; there
are
>no performance guarantees on string operations, I'm afraid.
>(Had the committee required that string assignment is constant time
>and not dependent on length, this would have forced a
reference-counting
>or similar implementation).

Unfortunately, as the design notes for the SGI implementation explain,
reference counted containers are incompatible with thread safety. You
can do tricks to make a compromised implementation of std::basic_string
that is thread safe (in the SGI STL sense), which sometimes reference
counts and sometimes deep copies. (I gather the description of
std::basic_string in the FDIS was carefully tweaked to make this
implementation possible.) But if you require amortised-constant copying,
I think this force reference counting too often; I don't think such an
implementation could be thread safe.

I realise not everyone thinks thread safety is vital, but for me and
many others, thread safety is a killer issue. I had to switch from EGCS
to MSVC because of this; I plan to switch back as soon as a thread safe
libstdc++ is available. I'd just like to put in a plea to the library
implementors to make sure they understand this issue, and not to
compromise thread safety in favour of efficiency. (Or at least to give
us the option.)

--
Ross Smith ................................... mailto:ross.s@ihug.co.nz
.............. The Internet Group, Auckland, New Zealand ..............
  "Remember when we told you there was no future? Well, this is it."
                                                        -- Blank Reg



^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: New STL implementation from SGI
@ 1998-07-13 17:29 Mike Stump
  0 siblings, 0 replies; 38+ messages in thread
From: Mike Stump @ 1998-07-13 17:29 UTC (permalink / raw)
  To: egcs, ross.s

> From: "Ross Smith" <ross.s@ihug.co.nz>
> To: <egcs@cygnus.com>
> Date: Mon, 13 Jul 1998 17:44:24 +1200

> I realise not everyone thinks thread safety is vital, but for me and
> many others, thread safety is a killer issue. I had to switch from
> EGCS to MSVC because of this; I plan to switch back as soon as a
> thread safe libstdc++ is available. I'd just like to put in a plea
> to the library implementors to make sure they understand this issue,
> and not to compromise thread safety in favour of efficiency. (Or at
> least to give us the option.)

If would be useful for us for you to add to the g++int.texi file a
chapter on thread safety, or more importantly, what isn't that you
think should be.  There are some of us that can do the work, if you
sensitize us to the issues.

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: New STL implementation from SGI
@ 1998-07-13 17:29 Mike Stump
  1998-07-14  8:41 ` Joe Buck
  0 siblings, 1 reply; 38+ messages in thread
From: Mike Stump @ 1998-07-13 17:29 UTC (permalink / raw)
  To: egcs, kunert

> Date: Mon, 13 Jul 1998 16:32:55 +0200
> From: Thomas Kunert <kunert@physik.tu-dresden.de>
> To: egcs@cygnus.com

> I hope this doesn't sound too stupid:

> What is the purpose of reference-counted strings? For portable code,
> one cannot depend on fast copy-operations

This is called a ``quality of implementation'' issue.  Sure, people
cannot rely safely of such things, but some people just don't care a
whole lot about performance and they are happy to give money to the
compiler company that gives them the best performace for their
application.

Or look at it a different way, sure you can portably rely upon
reference counted strings, because if a C++ compiler doesn't offer it,
you can just use g++, as _it_ is portable (for some definition of
portable).

> and if one writes code especially for egcs, rope is better
> anyway.

Ah, but that class is nonstandard (so far).  We might add it next time.

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~1998-07-14  8:41 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-02  7:08 New STL implementation from SGI Peter Simons
1998-07-06  4:08 ` Jeffrey A Law
1998-07-06  8:09   ` H.J. Lu
1998-07-06 14:48     ` Jeffrey A Law
1998-07-06 22:11       ` Ben Scherrey
1998-07-07  0:14         ` Jeffrey A Law
     [not found]         ` <6669.899795405.cygnus.egcs@hurl.cygnus.com>
1998-07-08 16:34           ` Nathan Myers
1998-07-06 18:52     ` Alex Buell
1998-07-07  5:29       ` Carlo Wood
1998-07-07 10:14         ` B. James Phillippe
1998-07-07 12:51         ` Martin von Loewis
1998-07-07 22:54           ` H.J. Lu
1998-07-08  9:58           ` Joe Buck
     [not found]           ` <199807081547.IAA06604.cygnus.egcs@atrus.synopsys.com>
1998-07-09 11:18             ` Ulrich Drepper
1998-07-09 17:02               ` Joe Buck
1998-07-09 17:40                 ` Ulrich Drepper
1998-07-10  6:04                 ` Pieter Nagel
1998-07-10 13:32                   ` Joe Buck
     [not found]                 ` <Pine.LNX.3.96.980710103559.18309h-100000.cygnus.egcs@basilisk>
1998-07-10 20:04                   ` Nathan Myers
     [not found]               ` <199807100002.RAA10346.cygnus.egcs@atrus.synopsys.com>
1998-07-10 16:49                 ` Nathan Myers
1998-07-07  1:12     ` Joe Buck
1998-07-06 18:10       ` H.J. Lu
1998-07-07  7:59         ` auto_ptr, new warning? (was: New STL implementation from SGI) Carlo Wood
1998-07-07 13:05           ` Joe Buck
     [not found] <x7sokk1h55.fsf.cygnus.egcs@peti.gmd.de>
1998-07-02 15:15 ` New STL implementation from SGI Nathan Myers
1998-07-03 12:21   ` Andi Kleen
1998-07-05 15:40     ` Martin von Loewis
     [not found] ` <k2d8bm4x5k.fsf.cygnus.egcs@zero.aec.at>
1998-07-05 19:46   ` Nathan Myers
1998-07-08  3:16     ` Gerald Pfeifer
1998-07-08 16:34       ` Branko Cibej
1998-07-07 22:54 Josh Stern
1998-07-11  6:31 Josh Stern
1998-07-13  1:48 Ross Smith
1998-07-13  8:40 ` Thomas Kunert
1998-07-13 15:28   ` Joe Buck
1998-07-13 17:29 Mike Stump
1998-07-13 17:29 Mike Stump
1998-07-14  8:41 ` Joe Buck

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).