Author: Dann Corbit
Date: 11:02:29 12/13/05
Go up one level in this thread
On December 13, 2005 at 10:05:18, Tord Romstad wrote: >On December 12, 2005 at 20:36:33, Dann Corbit wrote: > >>I predict he will have a very hard time writing a SMP version because of all the >>global variables. > >I really don't understand why people think this is such a big problem. >Rewriting >the whole program isn't a very difficult or time-consuming task (it's just a bit >boring). It's not at all like starting all over. You can keep most of the old >algorithms and data structures, and also copy big chunks of the code. > >I think doing a complete rewrite from time to time is a good thing to do anyway. >It helps you to correct old, unfortunate design decisions, and give you a good >opportunity to try new techniques. It is also a great way to find obscure old >bugs. I have done several conversions of large systems from single theading to SMP (not chess programs, but I guess it is quite similar). The answer is not just to critical section things because it becomes a huge bottleneck (you will get approximately single CPU speed). Sometimes, you will have to rethink the fundamental algorithms themselves. Debugging SMP programs can be particularly onerous. (The main product we sell where I work is a SMP system). You could do a wobbly port to SMP and get something with a rough speedup of 1.2 or so with very little work. But to do it right is a major task, I think. I think GCP's approach was very intelligent. While spawning processes is more expensive than spawning threads, it is much easier to have independent programs that use shared memory for important shared objects like the hash table. The clever thing about that approach is that you can still have statics and globals in your program and it does not matter as long as they are not in shared memory. This simplifies greatly the effort of gating access to shared resources. I guess that you cannot do an SMP port faster than the way that GCP did it. However, if you want to go to "the next level" by using threads which are a less expensive resource than a process, there is a lot more work to do.
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.