创建线程不要实用CreateThread

如果线程中需要使用C、C++库函数,创建线程时,不要使用CreateThread()创建线程,而应该使用_beginthreadex()。因为c、c++的一些库函数会访问一些全局变量,_begintheradex()给每个线程一份全局变量或进行加锁处理,而CreateThread()则不会。

posted @ 2012-09-17 21:38  -lw-  阅读(207)  评论(0编辑  收藏  举报