Problems with multi-threaded code on a dual processor, 8 core multi-processor.

I am working with multi-threaded code which is designed to be a single process spawning as many threads as there are cores on the computer. This software is written in C with Visual Studio 2005 under XP Pro SP2. It sucessfully works on a dual processor Dell 380 Precision workstation. Recently I moved these codes to a Dell 690 dual processor, quad core Xeon system (8 cores.) These codes work when the number of CPUs is restricted to 1,2,3, or 4 cores. But when I try to use 5 or more cores, the codes don't work, displaying symptoms similar to lack of thread synchronization, trashing of pointer arrays to NULL values, etc.

Has anyone with this problem found a fix? Does anyone have any suggestions how to debug this situation? Is there a known limitation with XP with this software topography, or is it more likely my software?

Thank you for your time.

[902 byte] By [JamesHITAdmin] at [2008-1-6]
# 1
I can't find the official word but I've got a feeling dual core is the max for XP Pro. In fact XP Pro x64 does say "support for dual core". Now that maybe just old marketing hopefully someone can give you a definitive answer. Have you tried running this on Win2003?
pkr2000 at 2007-9-28 > top of Msdn Tech,Architecture,Architecture General...
# 2

After a bit of investigation into this problem using all 8 cores on my multiprocessor PC, it turns out that my code was the problem. The responses to this thread were helpful, but since I didn't describe the structure of my code, the answers were speculative and didn't address my situation. In the end, it was simply an issue of overwriting thread array bounds which clobbered globally declared control variables.

JamesHITAdmin at 2007-9-28 > top of Msdn Tech,Architecture,Architecture General...