Is the new operator of C++ thread-safe?

--
--------
Tel:0571-87951792
yyj@vico-lab.com

Re: About the thread-safe of New Operator? by Ken

Ken
Fri Nov 21 08:52:41 CST 2003

"loggy" <yyj@vico-lab.com> wrote in message
news:efXPc4DsDHA.556@TK2MSFTNGP11.phx.gbl...
> Is the new operator of C++ thread-safe?

C++ as a standard doesn't deal with threads, so no. As far as "C++" is
concerned, threads don't exist, and nothing is threadsafe. Particular
implementations, however, are allowed to support threads and define their own
threadsafety.

The new operator in C++ as Microsoft Visual C++ is threadsafe, if and only if
you use a mutlithreaded runtime library. Check your project settings.

Ken



Re: About the thread-safe of New Operator? by loggy

loggy
Fri Nov 21 22:34:53 CST 2003

Thank you very much!

> C++ as a standard doesn't deal with threads, so no. As far as "C++" is
> concerned, threads don't exist, and nothing is threadsafe. Particular
> implementations, however, are allowed to support threads and define their
own
> threadsafety.
>
> The new operator in C++ as Microsoft Visual C++ is threadsafe, if and only
if
> you use a mutlithreaded runtime library. Check your project settings.
>
> Ken
>
>