【发布时间】:2012-03-12 13:04:52
【问题描述】:
我在 stackoverflow 上读到,当使用 Windows API 启动线程时,_beginthreadex() 优于 CreateThread()。
我正在使用CreateThread() 创建这样的线程:
DWORD WINAPI ThreadFunc(void* data)
{
// code for the thread functionality.
}
HANDLE Multicast = CreateThread(NULL, 0, ThreadFunc, NULL, 0, NULL);
if (Multicast) { } // thread started successfully.
如何使用 _beginthreadex() 而不是 CreateThread() 来做到这一点?
谁能发个例子?
【问题讨论】:
标签: c multithreading winapi