本文介绍了_beginthread VS的CreateThread的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是在Windows中的CreateThread和beginthread API之间的差异?哪一个是线程创建preferrable?
What is the difference between CreateThread and beginthread APIs in Windows? Which one is preferrable for thread creation?
推荐答案
_beginthread()
和 _beginthreadex()
被要求由早期版本的Microsoft CRT的初始化本地线程状态。在的strtok()
功能将是一个例子。这一直是固定的,即国家现在被动态初始化,至少从VS2005。使用的CreateThread()
不再会导致问题。
_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.
这篇关于_beginthread VS的CreateThread的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!