可能吗? [英] is it possible?

查看:83
本文介绍了可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以强制限制任务所占的CPU数量?


我正在考虑编写一个简单的应用程序,让我强迫其他人使用

应用程序很好只使用这么多的CPU。


这可能......这样的事情是否存在?

解决方案

< blockquote>


gregory_may写道:

是否可以强制限制任务所占用的CPU数量?

我正在考虑编写一个简单的应用程序,让我强迫其他
应用程序很好。通过只使用这么多的CPU。

这可能......这样的事情是否存在?




您可以设置优先级过程较低,但那不是你b $ b后面的那个,是吗?


在unix中你可以发送SIGSTOP和SIGCONT进程,我不要以为

在win32 api中有类似的东西。


也许这对你有帮助:
http://www.codeproject.com/threads/pausep.asp


-

Helge Jensen

mailto:他********** @ slog.dk
sip:他********** @ slog.dk

- =>塞巴斯蒂安的封面音乐: http://ungdomshus.nu < = -

<" gregory_may" <无>>写道:

是否可以强制限制任务所占用的CPU数量?

我正在考虑编写一个简单的应用程序,让我强制其他
应用程序很好通过只使用这么多的CPU。

这可能......这样的事情存在吗?




好​​吧,你可以设置线程'优先考虑低价值 - 当没有其他任何东西在运行时,它仍然会占用所有CPU,但其他东西

将优先于它。


线程优先级有点启发式 - 它更多的是指示

而不是保证。它可能对你很有帮助。


-

Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet 博客: http://www.msmvps.com/jon.skeet

如果回复小组,请不要给我发邮件


所以,如果我旋转一个假的话。从系统窃取CPU的空闲进程,我可以将b $ b分配回我想要有一些额外时间的进程(比如

用户界面)。


" gregory_may" <无>在消息中写道

新闻:O0 ************** @ TK2MSFTNGP11.phx.gbl ...

是否有可能强迫对任务所占CPU数量的限制?

我正在考虑编写一个简单的应用程序,让我强迫其他应用程序变得更好。只使用这么多的CPU。

这可能......这样的事情是否存在?



Is it possible to force a limit on the amount of CPU a task is taking?

I am thinking of writing a simple app that will let me force other
applications to "be nice" by only using so much CPU.

Is this possible ... does anything like this exist?

解决方案



gregory_may wrote:

Is it possible to force a limit on the amount of CPU a task is taking?

I am thinking of writing a simple app that will let me force other
applications to "be nice" by only using so much CPU.

Is this possible ... does anything like this exist?



You can set the priority of the process lower, but that''s not what you
are after, is it?

In unix you could send SIGSTOP and SIGCONT to the process, I don''t think
there is anything similar in the win32 api.

Perhaps this can be of help to you:
http://www.codeproject.com/threads/pausep.asp

--
Helge Jensen
mailto:he**********@slog.dk
sip:he**********@slog.dk
-=> Sebastian cover-music: http://ungdomshus.nu <=-


<"gregory_may" <None>> wrote:

Is it possible to force a limit on the amount of CPU a task is taking?

I am thinking of writing a simple app that will let me force other
applications to "be nice" by only using so much CPU.

Is this possible ... does anything like this exist?



Well, you can set the thread''s priority to a low value - it will still
take all the CPU when there''s nothing else running, but other things
will take priority over it.

Thread priorities are somewhat heuristic - it''s more of an indication
than a guarantee. It may well help you though.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


So, If I spin up a "fake" idle process to steal CPU from the system, could I
allocate cycles back to processes I wanted to have some extra time (like the
UI).

"gregory_may" <None> wrote in message
news:O0**************@TK2MSFTNGP11.phx.gbl...

Is it possible to force a limit on the amount of CPU a task is taking?

I am thinking of writing a simple app that will let me force other
applications to "be nice" by only using so much CPU.

Is this possible ... does anything like this exist?



这篇关于可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆