Use _beginthreadex, unless you're using MFC, in which case use
CreateThread.
DS
Tony
"Luis Pablo Prieto Santos" <lp...@tid.es> wrote in message
news:39F0621D...@tid.es...
> Well, I'm making some multithreaded programming with C in WinNT, and,
> after reading VC++ 6.0's "help" and other resorces, I don't know which
> to use and why. Can anybody help me?
> Thanx,
> Luis
>
>
_beginthreadex() and _endthreadex()
rather than:
_beginthread() and _endthread()
Why?
1) _beginthreadex() has exactly the same parameters as CreateThread in
exactly the same order, simplifying the conversion.
2) There are problems with _beginthread() and _endthread() related to
how they can close the handle under certain circumstances, leading to
undesirable race conditions. The "ex" versions don't introduce these
considerations.
If you continue to use CreateThread, be certain that your thread
function does not call the C library and never will call it, directly
or indirectly.
When using _beginthreadex() in the VC++ environment, don't forget to
set the project settings to multithreaded. That is, starting from
"Projects" on the toolbar:
projects -> settings -> C/C++ tab -> CodeGeneration -> MT DLL
Johnson (John) M. Hart
jmh...@world.std.com
In article <J63K5.2253$5b4.1...@bgtnsc05-news.ops.worldnet.att.net>,
Sent via Deja.com http://www.deja.com/
Before you buy.