bjwf ·
·
阅读: 917
你是说用fork 替代pthread_create ?
if(fork() == 0)
{
record the proc PID
do_somthing();
return;
}
..........
//////////////////////////////////////
//
if(do_somthing time out)
{
kill proc
}
你说的是这个意思吗?即使在do_something里有malloc,kill也不产生mem leak ?