您的最佳的信息源和新闻 远景, 景色硬件 并且 景色硬件 在互联网

景色文章 名列前茅50 景色录影 景色软 景色帮助

自动地名义上设置过程的优先权,在景色


最近我戏耍与 图像文件施行选择 并且Sysinternals’ 处理显示器在景色。 我看一次有趣的询问发生。 使用notepad.exe为例,我为称“PerfOptions的”钥匙看了询问在[HKEY_LOCAL_MACHINE \软件\微软\视窗NT \ CurrentVersion \图像文件施行选择\ notepad.exe],当我跑了笔记薄。 结果是命名没发现,因此我决定矫正那。 在增加名为“PerfOptions的”钥匙以后,我再跑了笔记薄。 在处理显示器,我为四价值看了询问:

由于最近探险与处理priorities*, CpuPriorityClass立即劫掠了我。 看 SetPriorityClass 作用,你能为dwPriorityClass参量看不同的价值。 我在PerfOptions创造了REG_DWORD名为CpuPriorityClass,并且设置了价值对0×80希望笔记薄将发射与“HIGH_PRIORITY_CLASS”的。 反而,它发射了以优先权NORMAL_PRIORITY_CLASS (8) -设置未造成任何冲击。 然后,我设置了价值到8并且发射了笔记薄。 笔记薄发射以优先权8。 我改变了价值到4,并且那没有冲击。 我改变了价值到0 -没有冲击。 我尝试了10 -没有冲击。 我不可能看任何领带对我知道处理优先权的任何其他目录,因此我决定从0开始尝试尝试,以以下结果:


CpuPriorityClass价值 笔记薄优先权 优先权类
1 4 懒惰
3 13
5 6 BelowNormal
6 10 AboveNormal
别的^ 8 正常

^=我当前跑a PowerShell 写电影脚本通过所有可能的价值重复(仅有关于2^32…) 如此它也许是一会儿在CpuPriorityClass价值之前为REALTIME_PRIORITY_CLASS,如果它存在,被揭露。 也许也有可以用于指定优先权类被揭露的其他价值。 我将更新或张贴一个新的题目,如果我揭露新的任何东西…

PowerShell剧本(不要笑,它是我的第一坚固企图一致) :

$cpc=0set-itemproperty “hklm :softwaremicrosoftwindows ntcurrentversionimage文件施行optionsnotepad.exeperfoptions” cpupriorityclass $cpcdo {    $pp = [diagnostics.process] : :开始(” notepad.exe”, “”)    $ppc = $pp.PriorityClass    $pp. 杀害()    如果($ppc - ne “法线”)    {        写主人$cpc $ppc    }    $cpc++    设置itemproperty “hklm :softwaremicrosoftwindows ntcurrentversionimage文件施行optionsnotepad.exeperfoptions” cpupriorityclass $cpc},当时($cpc - lt 4294967295)

有希望地,在PerfOptions - IoPriority、PagePriority和WorkingSetLimitInKB将发现时刻做一些开掘入其他价值的我。 IoPriority和PagePriority声音,如他们也许与有关 记忆prioritization 并且 IO prioritization 在景色。 WorkingSetLimitInKB sounds self-explanatory, but how it’s applied or how it’s used, and other circumstances, are quite vague.

*= SetThreadPriority, Vista, and Autostart Locations, Setting the Priority of a Service Process via Script

Popularity: 2%


Written by «/\/\Ø|ö±ò\/»®©. Read more great feeds at is source WEBSITE
1 comment.
Read more articles on otherSoftware and Process Monitor and priority and sysinternals and PowerShell and vista.

Related articles

1 comment

Read the comments left by other users below, or:

Get your own gravatar by visiting gravatar.com Henry Widmore
#1. January 31st, 2008, at 8:40 AM.

does this work for other os like XP or server 2003?

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .