Is is possible to configure Windows to only use a single hardware-thread. Every machine for the last couple of years seems to be at least dual-core, but some timing bugs are only reproducible when threads execute serially. I am particularly interested in Windows Vista.


David, let's first tackle your direct question: How to restrict Windows Vista to one core.

I see two ways:

(a) Run your Vista in a virtual machine on Hyper-V, and give the VM only one logical processor. This leaves you the rest of the machine to put to good use.

(b) Alternatively, you can use the /numproc=1 option in boot.ini to force the machine to use a single processor. You can configure this through msconfig.

  1. Click Start, click Run, type msconfig, and then click OK.
  2. Click the "Boot" tab.
  3. Click "Advanced options..."
  4. Click to select the "Number of processors" check box, and select "1".
  5. Click OK two times, and then restart the computer.

alt text http://i39.tinypic.com/141789i.png

But maybe it is enough to restrict just your program to a single core, then setting processor affinity is the preferrable answer. This can be achieved through configuration or directly from your process code.

Appart from these you might also want to consider advanced multitreading debugging tools such as Intel's Thread Checker if that applies to your environment.

| improve this answer | |

What you're looking for is how to set the 'process affinity', and how you set it depends on what program you are starting, and how you are starting it up.

I saw this answer on stack overflow: stackoverflow.com/questions/827754/....

| improve this answer | |

Also many machines can have SMP (& hyperthreading if relevent) disabled in the BIOS.

Timing bugs (or the common subset of race conditions) seem to be more generally reproducable on multi-core machines.

| improve this answer | |
  • Most, but not all. I once found a bug in a FindBugs which was only reproducible of a single threaded machine. – Tom Hawtin - tackline May 27 '09 at 2:45

You would want the /onecpu switch in boot.ini look at here: http://support.microsoft.com/kb/170756

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.