RE: How to disable dual cpu automatically before launchin- g an application

You forgot:

(3) Fix your application to behave properly in an SMP environment.

This is of course the correct approach. If it’s multithreaded, then consider
using synchronization objects to cause sequential (synchronous) functionality
until the multithreaded bug is fixed. If you can’t fix it, then maybe
SetProcessAffinityMask/SetThreadAffinityMask can be used. If you don’t have the
source to the misbehaving app, then you can create a “loader” program for it by
using CREATE_SUSPENDED to the CreateProcess call, tweak its affinity bits, and
then force the process to resume.


Paul Bunn,, 425-644-6000
Microsoft MVP - WindowsNT/2000

-----Original Message-----
From: []
Sent: Tuesday, April 03, 2001 5:34 AM
To: NT Developers Interest List
Subject: [ntdev] How to disable dual cpu automatically before launching
an application


I have an application that does not behave well when ran on dual cpu
systems. I am looking for a simple workaround to disable one cpu just prior
to lauching this application (ie: a batch file, or some other trick).

I have considered other alternatives like:

  1. insert /onecpu in the boot.ini line => but this disables dual cpu for
    all app’s which is not desired.

  2. Start the app in question - do “ctrl-alt-del”, select the process, and
    right click to use the “set affinity” to disable one cpu => does not work
    since the app is already started and damage is already done.

You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)