1

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 Windows threading: _beginthread vs _beginthreadex vs CreateThread C++

Community
  • 1
  • 1
Robben_Ford_Fan_boy
  • 7,544
  • 7
  • 55
  • 80

1 Answers1

2

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.

Hans Passant
  • 873,011
  • 131
  • 1,552
  • 2,371