Computer Chess Club Archives


Search

Terms

Messages

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

Author: Vincent Diepeveen

Date: 05:10:06 09/25/02

Go up one level in this thread


On September 25, 2002 at 07:59:18, Andreas Stabel wrote:

>On September 25, 2002 at 07:48:12, Vincent Diepeveen wrote:
>
>>Hello,
>>
>>I'm looking to a quick alternative for the windows
>>function WaitForSingleObject();
>>
>>It waits until it gets signaled or times out after xx milliseconds.
>>
>>I go use it for the i/o thread which is supposed to sit
>>idle till the end of a ply or till it checks for input or
>>the clock. I remember for unix something about select and
>>such but i completely lost that code. Also i want to know what
>>speed it runs at. Because the first 10 ply or so which get
>>out of hashtable with 40 legal moves, it is done instantly after
>>a ply starts, and obviously it means that i need to do this 400
>>times instantly after a search starts. i don't want to wait
>>real long there for just the first few ply!
>>
>>The second thing i sit with is that all processes at start of the search
>>need to sit idle till they get a job. Previously what i did was
>>letting them spin. That's pretty impossible. Under Irix i'm using
>>spin_lock() here. It suspends processes when it can't lock in.
>>Select and such i never managed to figure out and most likely
>>signalling interprocessor is pretty hard and manual page of irix
>>says that select only goes till 128 processors anyway. Partitions
>>bigger than that it doesn't work simply.
>>
>>So where spin_lock is an idea for irix, i might guess WaitforSingleObject
>>is working for windows (better alternatives i have an open mind for too)
>>and it's a mystery to me what to use under linux.
>>
>>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...
>>
>>I asked SGI and they had no good alternative for me apart from
>>the existing spin_lock which i already use and usema. So
>>i guess i go do it with spin_lock() there.
>>
>>Basically the machine is ideal for multiprocessing, but amazingly
>>there is not much info about it, like most OSes they focussed
>>even more upon multithreading (which i find a wrong approach, BOTH
>>should get attention). usema is something i will try if spin_lock()
>>doesn't work out well.
>>
>>Best Regards,
>>Vincent
>
>
>I think the good old select covers all this on Unix.
>
>Regards
>Andreas

i cannot use select() at all as i limit myself to  < 128 processor
partitions then.

also i have no idea how to get it to work and whether it can do
it 400 times a second instantly.





This page took 0.01 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.