This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem in new/delete in multithreaded app


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]