public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Is libstdc++ in stock egcs 1.1.2 thread-safe?
@ 1999-12-22  3:01 Shmulik Rippa
  1999-12-22  4:47 ` Martin v. Loewis
  1999-12-31 23:54 ` Shmulik Rippa
  0 siblings, 2 replies; 4+ messages in thread
From: Shmulik Rippa @ 1999-12-22  3:01 UTC (permalink / raw)
  To: gcc

We have some problems when running a multithreaded program on a double
CPU computer under Linux. The problem seems to be always close to places
of dynamic memory allocation (new). We are compiling with the following
thread related compiler options:

-D_REENTRANT -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS

Under the above setting, is the implementation of new and delete
thread-safe or do I have to take care of synchronization issues (mutex
and the like) by myself?

Opinions expressed in various documentation regarding the thread-safety
of libstdc++ vary widely. To what extent libstdc++ implementation is
thread-safe? Or is it not thread-safe at all? (Please note that I am not
talking about STL).

Additional info:
glibc: 2.0.7
Linux kernel: 2.2.x
egcs: stock 1.1.2
libstdc++: from stock egcs 1.1.2.

Any help is greatly appreciated.
begin:          vcard
fn:             Shmuel Rippa
n:              Rippa;Shmuel
org:            Orbotech
adr:            Orbotech, LTD;;POBox 215;Yavne;;;Israel
email;internet: shmulik@orbotech.com
title:          Head of algorithms group
tel;work:       +972-8-942-3872
tel;fax:        +972-8-942-3800
tel;home:       +972-3-674-0854
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard

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

* Re: Is libstdc++ in stock egcs 1.1.2 thread-safe?
  1999-12-22  3:01 Is libstdc++ in stock egcs 1.1.2 thread-safe? Shmulik Rippa
@ 1999-12-22  4:47 ` Martin v. Loewis
  1999-12-31 23:54   ` Martin v. Loewis
  1999-12-31 23:54 ` Shmulik Rippa
  1 sibling, 1 reply; 4+ messages in thread
From: Martin v. Loewis @ 1999-12-22  4:47 UTC (permalink / raw)
  To: shmulik; +Cc: gcc

> Under the above setting, is the implementation of new and delete
> thread-safe or do I have to take care of synchronization issues (mutex
> and the like) by myself?
[...]
> Additional info:
> glibc: 2.0.7
> Linux kernel: 2.2.x
> egcs: stock 1.1.2
> libstdc++: from stock egcs 1.1.2.

On this platform, provided gcc was configured with --enable-threads,
new and delete should be thread safe. New and delete only uses the
underlying malloc/free and exception handling, which in turn are
thread-safe.

As for libstdc++ (which new and delete is *not* part of): it is
"supposedly" thread-safe, if configured with --enable-threads. Both
STL and libio/iostreams should be ok. For <string>, there are reports
that there are problems, although nobody could point to the
problematic code, so far.

Regards,
Martin

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

* Is libstdc++ in stock egcs 1.1.2 thread-safe?
  1999-12-22  3:01 Is libstdc++ in stock egcs 1.1.2 thread-safe? Shmulik Rippa
  1999-12-22  4:47 ` Martin v. Loewis
@ 1999-12-31 23:54 ` Shmulik Rippa
  1 sibling, 0 replies; 4+ messages in thread
From: Shmulik Rippa @ 1999-12-31 23:54 UTC (permalink / raw)
  To: gcc

We have some problems when running a multithreaded program on a double
CPU computer under Linux. The problem seems to be always close to places
of dynamic memory allocation (new). We are compiling with the following
thread related compiler options:

-D_REENTRANT -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS

Under the above setting, is the implementation of new and delete
thread-safe or do I have to take care of synchronization issues (mutex
and the like) by myself?

Opinions expressed in various documentation regarding the thread-safety
of libstdc++ vary widely. To what extent libstdc++ implementation is
thread-safe? Or is it not thread-safe at all? (Please note that I am not
talking about STL).

Additional info:
glibc: 2.0.7
Linux kernel: 2.2.x
egcs: stock 1.1.2
libstdc++: from stock egcs 1.1.2.

Any help is greatly appreciated.
begin:          vcard
fn:             Shmuel Rippa
n:              Rippa;Shmuel
org:            Orbotech
adr:            Orbotech, LTD;;POBox 215;Yavne;;;Israel
email;internet: shmulik@orbotech.com
title:          Head of algorithms group
tel;work:       +972-8-942-3872
tel;fax:        +972-8-942-3800
tel;home:       +972-3-674-0854
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard

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

* Re: Is libstdc++ in stock egcs 1.1.2 thread-safe?
  1999-12-22  4:47 ` Martin v. Loewis
@ 1999-12-31 23:54   ` Martin v. Loewis
  0 siblings, 0 replies; 4+ messages in thread
From: Martin v. Loewis @ 1999-12-31 23:54 UTC (permalink / raw)
  To: shmulik; +Cc: gcc

> Under the above setting, is the implementation of new and delete
> thread-safe or do I have to take care of synchronization issues (mutex
> and the like) by myself?
[...]
> Additional info:
> glibc: 2.0.7
> Linux kernel: 2.2.x
> egcs: stock 1.1.2
> libstdc++: from stock egcs 1.1.2.

On this platform, provided gcc was configured with --enable-threads,
new and delete should be thread safe. New and delete only uses the
underlying malloc/free and exception handling, which in turn are
thread-safe.

As for libstdc++ (which new and delete is *not* part of): it is
"supposedly" thread-safe, if configured with --enable-threads. Both
STL and libio/iostreams should be ok. For <string>, there are reports
that there are problems, although nobody could point to the
problematic code, so far.

Regards,
Martin

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

end of thread, other threads:[~1999-12-31 23:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-22  3:01 Is libstdc++ in stock egcs 1.1.2 thread-safe? Shmulik Rippa
1999-12-22  4:47 ` Martin v. Loewis
1999-12-31 23:54   ` Martin v. Loewis
1999-12-31 23:54 ` Shmulik Rippa

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