| 发表于:2007-09-21 12:34:1910楼 得分:10 |
做个简单的试验就知道了: thread1: for(int i=0;i <100000;i++) { handle h = createthread(0,0,(lpthread_start_routine)fun,0,0,0); waitforsingleobject(h,0xffffffff); closehandle(h); } thread2: for(int i=0;i <100000;i++) { handle h = createthread(0,0,(lpthread_start_routine)fun,0,0,0); //waitforsingleobject(h,0xffffffff); //closehandle(h); } ctrl+alt+del打开任务管理器,看资源的使用情况,事实证明closehandle是必要的 | | |
|