简体   繁体   English

IEXPLORE.exe的奇怪的ProcessorAffinity问题

[英]Strange ProcessorAffinity issue with IEXPLORE.exe

I need to launch IE and set the affinity to a particular single CPU. 我需要启动IE并将亲和力设置为特定的单个CPU。 When running the following c# code, as expected notepad.exe is started and has it's affinity set to just cpu2, strangely iexplore.exe is started with its affinity set to just cpu0. 运行以下c#代码时,按预期方式启动notepad.exe并将其亲和性设置为cpu2,奇怪的是,启动iexplore.exe时其亲和性设置为cpu0。 No matter what I set ProcessorAffinity to iexplore.exe always goes to cpu0. 无论我将ProcessorAffinity设置为iexplore.exe为何,总会进入cpu0。

I have tested this on 4 core xp 32 bit and 4 core 2008 64 bit, both IE8. 我已经在IE8的4核xp 32位和4核2008 64位上对此进行了测试。

using System;
using System.Diagnostics;
public class Launch
{

    public static void Main(string[] args)
    {
        lauchWithAffinity("c:/windows/system32/notepad.exe");
        lauchWithAffinity("c:/Program Files/Internet Explorer/IEXPLORE.EXE");
    }
    static void lauchWithAffinity(string exePath)
    {
        ProcessStartInfo start = new ProcessStartInfo();
        start.FileName = exePath;
        Process myProcess =Process.Start(start);
        myProcess.ProcessorAffinity = (System.IntPtr)4; //3rd cpu aka cpu2 
        //http://msdn.microsoft.com/en-us/library/system.diagnostics.process.processoraffinity.aspx
    }

}

I have tested your program and it works fine for me. 我已经测试了您的程序,对我来说效果很好。 I even checked in the task manager and the affinity of iexplore.exe is set to CPU 2. 我什至在任务管理器中签入,并将iexplore.exe的相似性设置为CPU 2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 的Process.Start(“IEXPLORE.EXE”); &lt; - 这可靠吗? - Process.Start(“IExplore.exe”); <— Is this reliable? Process.Kill似乎不适用于iexplore.exe - Process.Kill does not seem to work with iexplore.exe C#-使用iexplore.exe -embeddding导航URL? - c# - navigate url with using iexplore.exe -embedding? Process.Start("IExplore.exe"); --&gt; System.IO.FileNotFoundException - Process.Start("IExplore.exe"); --> System.IO.FileNotFoundException Process.Start(“ IExplore.exe”,“ http://google.com”)未在VM上启动。 在服务器和本地上工作 - Process.Start(“IExplore.exe”, “http://google.com”) Not Launching On VM. Works on Server and Local c#:是否可以将参数挂接到现有进程。 启动iexplore.exe,然后使其导航到网站的示例 - c# : is it possible to hook arguments to an existing process. Example launching iexplore.exe and then making it to navigate to a website Process.Start(“IEXPLORE.EXE”)在启动后立即触发退出事件..为什么? - Process.Start(“IEXPLORE.EXE”) immediately fires the Exited event after launch.. why? .NET ProcessorAffinity计算 - .NET ProcessorAffinity calculation 为什么要为线程设置ProcessorAffinity? - Why set the ProcessorAffinity for a thread? Process.ProcessorAffinity和Thread.ProcessorAffinity之间的区别 - Difference between Process.ProcessorAffinity and Thread.ProcessorAffinity
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM