?
Solved

Is is possible to permanently set processor affinity?

Posted on 1997-12-13
5
Medium Priority
?
1,955 Views
Last Modified: 2013-12-28
I have a dual processor Pentium Pro and I wish to always run a given application on one processor or the other ("hard affinity" in Microsoft terms).  I know how to temporarily set it through the task manager but this application-to-processor association is lost when the application ends.

The primary application I use is Microsoft Excel 95/97.  I am looking for means by which I can "permanently" set this processor affinity (utility, registry tweak, etc.).
0
Comment
Question by:swartwe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 4

Expert Comment

by:TimCaturaHouser
ID: 1787470
I don't know of a meathod for this. MS is very proud of the fact that most of their apps usually run faster with SMP. Are you saying Excel runs faster with 1 processor?
0
 

Author Comment

by:swartwe
ID: 1787471
I don't mean to imply that Excel runs faster with one processor.  However, I have an Excel application which often requires hours to run and I want to dedicate it to one processor so that system response will always be good, regardless of what Excel is doing (even though doing so will cause the Excel application take considerably longer to run).  This is why I want to explicitly set the affinity.
0
 

Accepted Solution

by:
plummer earned 200 total points
ID: 1787472
Create a simple application as follows:

void main(int argc, char ** argv)
{
    // Set desired affinity
    SetProcessorAffinity( ...whatever affinity you'd like...);
    // Launch Excel and let it inherit this affinity
    CreateProcess("C:\Program Files\...\excel.exe");
}

Then compile this and call it "myexcel.exe" or whatever.  When you run it, it will launch excel proper.
0
 

Author Comment

by:swartwe
ID: 1787473
I cannot find the function "SetProcessAffinity" within the context of VC++ 5.0.  However, I can find "SetProcessAffinityMask".  It that the correct function?
0
 

Author Comment

by:swartwe
ID: 1787474
Correction to the last comment...It should have read "I cannot find the function "SetProcessorAffinity"...".  

Incidently, I found SetProcessAffinityMask in winbase.h.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question