Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: basic multithreading question

Author: Peter Schäfer

Date: 08:05:16 11/09/04

Go up one level in this thread



>>I would estimate the chances of it working correctly to be about 0%. If you
>>haven't done multithreaded programming on a multiprocessor machine, then the
>>chances are much lower.
>>
>>Maybe it is possible to do it (and be confident it will work) using some
>>elaborate scheme (like wrapping every variable in a mutex protected class), but
>>the program would probably end up 100 times slower than the single processor
>>version :)

It's not that difficult, actually.
You need only to be concerned about data structures that are shared between
threads (the hash table, for example).

You can develop on a single processor machine. However, testing on a
multi-processor machine is recommended, since design flaws will be exposed much
faster (speaking from experience).

The following article by Bob Hyatt could be interesting for you:
 http://www.cs.unimaas.nl/icga/journal/contents/content25-1.htm#LOCKLESS
it introduces a thread-safe hash table without locks.



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.