Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

4 Answers 4

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

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.

share|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/....

share|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.

share|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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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