Sandeep Karanth | 28 May 18:20 2012
Picon

Pjlib CreateThread v/s _beginthreadex

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>&nbsp; &nbsp; &nbsp;I am curious to know &nbsp;the reason for using the CreateThread API rather than _beginthreadex &nbsp;in pj_thread_create() function in pjlib/os_core_win32.c file. The reason I ask this question &nbsp;is because at the link&nbsp;<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>&nbsp;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" .&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; 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>&nbsp;) . Is there any specific reason as to why the library uses CreateThread rather than _beginthreadex?<br clear="all"><div><br></div>
<br>
</div>
</div>

Gmane