Computer Chess Club Archives




Subject: Re: POSIX threads

Author: Lance Perkins

Date: 02:49:43 07/05/05

Go up one level in this thread

My point here is that you "always" need to test on multi-cpu machine if you are
writing a multi-threaded app.

This statement is simply not true: "an SMP-aware prgram can be developed and
tested on a single CPU machine"

I have even seen some of our apps run perfectly on 2-cpu machines but fail on
4-cpu machines.

As for the programming itself, I consider it a no-brianer since its just another
bunch of API's that gets used over and over again each time you need to do
threaded apps. The best practice is not even to use the raw API's but to wrap
them in classes that do their own reference counting and garbage collection.

On July 05, 2005 at 05:12:17, Andreas Guettinger wrote:

>I don't agree in general. Doing posix programming right is surely no no-brainer.
>I don't know how you come to this conclusion, maybe if one just starts to create
>threads and uses no communication between them. Signaling and synchronisation
>between threads is not so easy, i would definitely not call it a no-brainer.
>On the other hand, if done correctly, it should also run on a dual CPU machine
>with maybe some minor adjustements. Of course it has to be tested on the dual,
>because there is always something going not the expected way.
>On July 05, 2005 at 05:02:54, Lance Perkins wrote:
>>Not true.
>>Testing a multi-threaded app on a single-cpu machine is bogus. Its very easy to
>>write a multi-threaded app. Its a no brianer. But to be sure that it actually
>>works on a multi-cpu machine, you have to test it on one.
>>On a single-cpu machine, the threads never run in parallel. A shared resource
>>will never be accessed simultaneously.
>>I have tons of horror stories about this from newbie programmers.
>>On July 05, 2005 at 03:56:29, Steven Edwards wrote:
>>>On July 05, 2005 at 03:31:42, Tord Romstad wrote:
>>>>On July 04, 2005 at 23:36:39, Juan Pablo Naar C. wrote:
>>>>>Is coding for SMP really hard?
>>>>It is, especially when you don't have a dual CPU computer.
>>>>There are still very few of us who have one.  Duals are still
>>>>too big, noisy and expensive for the average customer.
>>>>This will, of course, change in the future (probably in the
>>>>near future).  When duals become more common, I am
>>>>sure the number of parallell chess programs wil increase
>>>If the host and target platforms are POSIX compliant (e.g., Mac OS/X and Linux),
>>>then adherence to the POSIX thread model specification is relatively simple and
>>>so an SMP-aware prgram can be developed and tested on a single CPU machine.
>>>This is part of Symbolic's development method.

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.