> -----Original Message-----
> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
> Sent: Thursday, July 26, 2007 9:15 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: svn commit: r559890 -
> /incubator/stdcxx/trunk/tests/src/thread.cpp
>
> faridz@apache.org wrote:
> > Author: faridz
> > Date: Thu Jul 26 10:23:23 2007
> > New Revision: 559890
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=559890
> > Log:
> > 2007-07-26 Farid Zaripov <Farid_Zaripov@epam.com>
> >
> > * thread.cpp (rw_thread_create) [_WIN32]: Use
> _beginthreadex() instead of CreateThread().
>
> What are the advantages of calling _beginthreadex() instead
> of CreateThread? I ask because I thought that
> _beginthreadex() was implemented in terms of CreateThread().
The _beginthreadex() allocates and initializes the thread local
data before invoking the user thread function, and frees that data
after return from user thread function.
>From MSDN:
----------
A thread in an executable that calls the C run-time library (CRT)
should use the _beginthread and _endthread functions for thread
management rather than CreateThread and ExitThread; this requires
the use of the multi-threaded version of the CRT.
----------
Farid.
|