Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Approaches to threading

Author: Anthony Cozzie

Date: 18:16:25 06/15/04

Go up one level in this thread


On June 15, 2004 at 19:10:33, Russell Reagan wrote:

>On June 15, 2004 at 18:01:07, Sean Empey wrote:
>
>>Since you are writing it in C look at: _beginthread
>
>Actually, you should use _beginthreadex() and _endthreadex(). CreateThread()
>links to the single threaded C run time libraries, while _beginthread() and
>_beginthreadex() link to the multithreaded C run time libraries. If you know you
>are using the C run time libraries, you should use _beginthreadex(). If you
>think you aren't using the C run time libraries, you should still use
>_beginthreadex(), because it is almost impossible to know for sure that some
>other library isn't using the C run time library under the hood.
>_beginthreadex() is to be preferred over _beginthread() because _beginthread()
>can cause an unrecoverable race condition in some cases. To be safe, use
>_beginthreadex() and _endthreadex().

I am not saying you are wrong, but wouldn't it be incredibly moronic to have a
function that creates a thread link to the single-threaded run time libraries?

anthony



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.