设定我自己的优先权 [英] Set my own priority
本文介绍了设定我自己的优先权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一个长期运行的密集型应用程序。我想要
来设置我自己的优先级。大部分时间我都想降低它,所以我不会吃掉整个处理器上的
。
我知道如何用线程做到这一点,但对自己(可以这么说)怎么样?
谢谢,
Tom
I''ve got a long running, intensive application that I am writing. I''d like
to set my own Priority. Most of the time I want to lower it so I don''t eat
up the entire processor.
I know how to do it with a thread, but how about to myself (so to speak)?
Thanks,
Tom
推荐答案
嗨汤姆,
这里有一个链接,不要害怕,因为你当前的应用程序线程是
只是
threading.ThreadPriority.BelowNormal
http://msdn.microsoft.com/library/de...classtopic.asp
我希望这有帮助吗?
Cor
Hi Tom,
Here a link, do not become afraid, for your current application thread it is
just
threading.ThreadPriority.BelowNormal
http://msdn.microsoft.com/library/de...classtopic.asp
I hope this helps?
Cor
*Tom Scales <到**** @ softhome.net> scripsit:
* "Tom Scales" <to****@softhome.net> scripsit:
我正在编写一个长期运行的密集型应用程序。我想要设置自己的优先级。大部分时间我都想降低它,所以我不会吃掉整个处理器。
我知道怎么用线程来做,但对自己怎么样(所以说话??
I''ve got a long running, intensive application that I am writing. I''d like
to set my own Priority. Most of the time I want to lower it so I don''t eat
up the entire processor.
I know how to do it with a thread, but how about to myself (so to speak)?
''System.Threading.Thread.CurrentThread.Priority = Threading.ThreadPriority.Lowest''。
-
Herfried K. Wagner [MVP]
< http://www.mvps.org/dotnet>
''System.Threading.Thread.CurrentThread.Priority = Threading.ThreadPriority.Lowest''.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
''更改应用程序线程的优先级。
Sub SetAppPriority(_
ByVal Thread As System.Threading.Thread,_
ByVal NewPriority As System.Threading.ThreadPriority)
''更改指定线程的优先级
''ThreadPriority是以下之一:
''AboveNormal
''BelowNormal
''最高
''最低价
''正常
''
Thread.Priority = NewPriority
结束子
Tom Scales <到**** @ softhome.net>在消息中写道
新闻:fq ******************** @ comcast.com ...
'' Change the priority of the application''s thread.
Sub SetAppPriority( _
ByVal Thread As System.Threading.Thread, _
ByVal NewPriority As System.Threading.ThreadPriority)
'' Change the priority of the specified thread
'' ThreadPriority is one of:
'' AboveNormal
'' BelowNormal
'' Highest
'' Lowest
'' Normal
''
Thread.Priority = NewPriority
End Sub
"Tom Scales" <to****@softhome.net> wrote in message
news:fq********************@comcast.com...
我我正在编写一个长期运行的密集型应用程序。我想要设置自己的优先级。大部分时间我都想降低它,所以我不会吃掉整个处理器。
我知道怎么用线程来做,但对自己怎么样(所以发言)?
谢谢,
Tom
I''ve got a long running, intensive application that I am writing. I''d like
to set my own Priority. Most of the time I want to lower it so I don''t eat
up the entire processor.
I know how to do it with a thread, but how about to myself (so to speak)?
Thanks,
Tom
这篇关于设定我自己的优先权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文