pthreads and operator new

Markus Schaber schabi at logix-tt.com
Fri Mar 16 13:00:18 UTC 2007


Hi,

I did not find a definitive source on the net (due to lots of false
positives when googling), but I found this list that seems to discuss
C++ / pthread library issues.

My question is simple: Does the combination of C++98 and Posix pthread
standards give any guarantee that the operator new is "thread safe",
means that several threads can allocate objects via "new" concurrently
without explicit locking by the user code? 

Our current research seems to indicate that pthread standards don't
mention C++ in any way, and C++ does not mention threads, and it is
pure benevolence (or plain sanity?) of the implementations I have seen
up to now to provide a thread safe implementation of new (mostly based
on a global lock).

Some pointers to mandatory sources or better places to discuss this
issue are welcome.

Thanks a lot,
Markus

-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org



More information about the c++-pthreads mailing list