使 ServicedComponent 以较低优先级运行
我们有一个 ServicedComponent
(COM+ 服务器应用程序),它是 CPU 密集型的。它是从 Windows 服务调用的,完成它所需的时间并不是很重要。
但是,我确实需要它以较低的优先级运行。我怎样才能改变它的优先级?
We have a ServicedComponent
(COM+ server application) which is quite CPU intensive. It's called from a Windows Service and the amount of time it takes for it to complete is not very important.
However, I do need it to run with lower priority. How can I change it's priority?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你必须将Windows服务优先级设置为低。
所以请查看下面的链接。希望有帮助。
http://social. msdn.microsoft.com/Forums/en-US/netfxbcl/thread/0799ff95-3596-40e0-9fd1-c79b4ffab731/
I think you have to set the windows service priority to low.
So please look into the below link. Hope that helps.
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/0799ff95-3596-40e0-9fd1-c79b4ffab731/
我假设您的组件正在服务器应用程序中运行(在 Windows 服务的进程外)。
如果是这种情况,您可以在类构造函数中将 COM+ 进程的优先级设置为
BelowNormal
:如果我运行一个简单的测试,则 dllhost.exe 进程优先级将设置为 BelowNormal。
I'm assuming that your component is running in a Server Application (out of process from your windows service).
If that is the case you could set the priority of the COM+ process to be
BelowNormal
in the class constructor:If I run a simple test the dllhost.exe process priority is set to be BelowNormal.