28 May 2012 18:20
Pjlib CreateThread v/s _beginthreadex
Sandeep Karanth <sandeepk.kdp <at> gmail.com>
2012-05-28 16:20:31 GMT
2012-05-28 16:20:31 GMT
Hi Benny and team,
I am curious to know the reason for using the CreateThread API rather than _beginthreadex in pj_thread_create() function in pjlib/os_core_win32.c file. The reason I ask this question is because at the link http://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85).aspx it mentions "A thread in an executable that calls the C run-time library (CRT) should use the _beginthreadex and _endthreadex functions for thread management rather than CreateThread and ExitThread; this requires the use of the multithreaded version of the CRT" .
I also saw a question posted in the mailing list regrading this ( http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2010-October/012061.html ) . Is there any specific reason as to why the library uses CreateThread rather than _beginthreadex?
<div> <p>Hi Benny and team,</p> <div> I am curious to know the reason for using the CreateThread API rather than _beginthreadex in pj_thread_create() function in pjlib/os_core_win32.c file. The reason I ask this question is because at the link <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85).aspx</a> it mentions "A thread in an executable that calls the C run-time library (CRT) should use the _beginthreadex and _endthreadex functions for thread management rather than CreateThread and ExitThread; this requires the use of the multithreaded version of the CRT" . </div> <div> I also saw a question posted in the mailing list regrading this ( <a href="http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2010-October/012061.html">http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2010-October/012061.html</a> ) . Is there any specific reason as to why the library uses CreateThread rather than _beginthreadex?<br clear="all"><div><br></div> <br> </div> </div>
RSS Feed