Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: UNIX question: WaitForSingleObject() under IRIX/Linux

Author: Robert Hyatt

Date: 12:19:01 09/26/02

Go up one level in this thread


On September 26, 2002 at 07:53:11, Vincent Diepeveen wrote:

>On September 25, 2002 at 17:52:19, Miguel A. Ballicora wrote:
>
>I wrote too much text again, sorry for that,
>but the 3 crucial lines were:
>
>>The problem is i can't use pthread_cond_wait, because
>>it's not only an i/o thread that has to get signalled, but
>>several other processes must be able to do it too...
>
>obviously i can't use any of the pthread_ calls like Bob explained.
>
>If threads according to Nalimov are so much the same like a process,
>i don't see why all the unix OSes do not have the same functions working
>for processes...


There is only one basic difference between threads and processes.  With
processes, when you fork() you create a _total_ copy (except for read-only/
execute-only pages) of everything.  Threads don't do this.  That makes it
much more complex to synchronize between heavyweight processes (fork) and
threads (pthread_create).

As a result, the O/S assumes that if the processes are "tightly coupled"
(as in threads) then synchronization is needed.  If the author goes to
heavyweight (very loosely coupled) processes, then the synchronization
is not needed...


>
>>On September 25, 2002 at 07:48:12, Vincent Diepeveen wrote:
>>
>>>Hello,
>>>
>>>I'm looking to a quick alternative for the windows
>>>function WaitForSingleObject();
>>
>>I think that you are looking for
>>pthread_join();
>>
>>That is what I use and it works exactly the same.
>>
>>I use this in windows:
>>
>>static void engine_thread_wait(void)
>>{
>>    WaitForSingleObject (Engine_ID, INFINITE);
>>}
>>
>>And the equivalent in Linux:
>>
>>static void engine_thread_wait(void)
>>{
>>    void *p;
>>    pthread_join (Engine_ID, &p);
>>}
>>
>>Regards,
>>Miguel



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.