Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: basic multithreading question

Author: Russell Reagan

Date: 23:12:37 11/08/04

Go up one level in this thread


On November 09, 2004 at 01:32:53, Daniel Shawul wrote:

>  1.Can I program on a single CPU computer?or Do i need at least a dual?

Yes, you can use a single CPU machine to start, but don't assume that it will
run correctly on a multiprocessor machine just because it runs correctly on a
single processor machine (because it won't).

>  2.if (1) is possible,can i be sure it works on a dual.

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 :)

>  3.Do i need to write different code for different OS(windows and linux).
>     Or is it part of the C Language.

Threading is not part of the C language. You either need to write different code
for each OS, or you need to use a portable threading library. For C, pthreads
are popular.



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.