This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Problem in new/delete in multithreaded app
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: Problem in new/delete in multithreaded app
- From: "DUHRA,SARABJEET (HP-Cupertino,ex1)" <sarabjeet_duhra at am dot exch dot hp dot com>
- Date: Mon, 4 Sep 2000 17:52:29 -0600
Hi ,
I am using gcc version 2.9-hppa-991112 running on HPUX 11.00
9000/820 .
I am running a simple program which starts 100 threads ( using pthreads)
and then each thread calls new/delete in a for loop.
This program dumps core after running for a minute.
If i modify the program to use malloc/free , it runs fine.
My question is : is new/delete thread-safe on gcc?.
I am attaching the program.
regards
sarab
<<main.cpp>>
main.cpp