Author: Russell Reagan
Date: 23:31:10 11/17/04
Go up one level in this thread
On November 18, 2004 at 01:07:57, Daniel Shawul wrote:
>>>Do you block the main(parent) thread when search is split? i have read ('m not
>>>sure though) this may cause a problem but it seems to work fine for me.
>>I don't. that way I just have four threads at all times, never blocked threads
>>waiting on busy threads. That is a performance reducer... It is easier to use
>>your idea, but a little less efficient.
> I am not sure if i understnt this part. Blocking the main thread means one
>less worker,so it can't be more efficient. but it may help for communication,for
>example when a fail high is reported by a thread.
He is saying (I think) that you could do this two ways. Let's say you're using a
dual CPU machine.
1. Main thread blocked (waiting for input), two search threads (3 threads total)
2. Main thread (also a searcher), plus one extra search thread (2 threads total)
The result is about the same. You have two search threads in both cases, but in
case 1 you have an idle thread doing nothing 99% of the time. An idle thread
doesn't do much, but it isn't free either. It still gets a turn just like the
other threads. So he said it is "a little less efficient".
I wonder how the multiprocess approach would compare to this multithreaded
approach. What if you had (on a dual machine) a driver process which just reads
from xboard (or whatever), and two worker processes doing the search. If you
lower the priority of the driver process, does that help? Or is there any way to
set thread priorities so an idle thread doesn't get a turn as often? Or does the
OS already take care of this automatically?
The multiprocess approach seems a little simpler to me, but for maximum
performance it seems like multiple threads are the way to go. With multiple
processes you also have some unecessary duplication of data, but that can be a
good thing or a bad thing depending upon the circumstance I suppose.
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.