在多线程中使用标准C++ string类型中substr时怎么总是异常?详情请进!
vc8 2004-04-30 10:31:33 线程类样内容:
void thread()
{
string str1, str2;
str1 = "349ejoasdiufo93809384oiiahejf98374aoishfd";
while(1 )
{
str2 = str1.substr( 0, 16 );
}
}
我起50个线程一会程序就会异常,最终定位到operator new 或 poerator delete
请问是new 或delete 不支持多线程吗?还是其他什么原因应如何解决?多谢