views:

272

answers:

2

Are the new and delete operators thread-safe in pthreads-w32 for visual c++?

What things should I assume will always be thread-safe in pthreads-w32?

+1  A: 

I think the C++ standard doesn't say anything about thread-safety. Threads are simply not (yet) part of the concept. But I'm sure each compiler vendor has his/her own answer to that question. Check your compiler's documentation. I'd be surprized if the built-in new/delete operators were not thread-safe.

sellibitze
I was a bit irritated, pthreads is a C lib and I thought the question was regarding some new/delete implementation in pthreads!!! The default new/delete are thread safe (global heap lock is used, which costs some performance drop in single threaded apps)
jdehaan
A: 

As far as I know, all system functions are thread safe, if you build your project with 'Multi-threaded' run-time libraries.

Vova