Subject: Pjlib CreateThread v/s _beginthreadex
Date: Monday 28th May 2012 16:20:31 UTC (over 5 years ago)
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?