Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pthreads and operator new


  • To: C++ Pthreads Discussion list <c++-pthreads@xxxxxxxxxxxxxxxx>
  • Subject: pthreads and operator new
  • From: Markus Schaber <schabi@xxxxxxxxxxxx>
  • Date: Fri, 16 Mar 2007 14:00:18 +0100

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