Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

_beginthread vs CreateThread

What is the difference between CreateThread and beginthread APIs in Windows? Which one is preferrable for thread creation?

like image 668
Jay Avatar asked Jan 20 '10 10:01

Jay


1 Answers

_beginthread() and _beginthreadex() was required by earlier versions of the Microsoft CRT to initialize thread-local state. The strtok() function would be an example. That's been fixed, that state now gets dynamically initialized, at least since VS2005. Using CreateThread() no longer causes problems.

like image 55
Hans Passant Avatar answered Oct 20 '22 03:10

Hans Passant