Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: POSIX threads

Author: Dann Corbit

Date: 13:29:32 07/05/05

Go up one level in this thread


On July 05, 2005 at 14:54:38, Steven Edwards wrote:

>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.
>
>Wrong.  You are limiting the concept of a shared resource to a single memory
>access.  A shared resource may be an entire table or even an executable object.
>Without protection by, say, a POSIX mutex, a program on a single processor
>machine running multiple threads may fail.

Most SMP faults are probabilistic in nature.

The odds of failure go up exponentially with SMP on multiple CPU machines as the
CPU count rises.

I have used this to help debug SMP faults by doing the debugging on a 4 CPU
machine to generate the faults much faster.

I have also seen faults generated on single CPU machines, particularly under
OS/2, but they are more difficult to trigger and could easily go unnoticed.



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.