开发者

Windows Threading: beginthread or QueueUserWorkItem (C++)

开发者 https://www.devze.com 2022-12-31 13:53 出处:网络
I am wondering whether to use beginthread or QueueUserWorkItem for threaded methods in C++.What are the differences between the two APIs and in what context are they better suited?

I am wondering whether to use beginthread or QueueUserWorkItem for threaded methods in C++. What are the differences between the two APIs and in what context are they better suited?

Thanks,

BTW, I have read this question W开发者_如何学运维indows threading: _beginthread vs _beginthreadex vs CreateThread C++


QUWI uses a thread from the thread pool to execute the callback function. Such threads are very light weight but not suitable for all types of threaded tasks. Basic requirements are that they need to be relatively short-lived, don't block very often and are not time critical.

It is all rather well explained in the SDK topic.

0

精彩评论

暂无评论...
验证码 换一张
取 消