suspends any threads/processes for limiting cpu usage? or you can search 'cpu usage limit ' on google or baidu. the memory of any processes only can be reformed via the api setworkingsetsize, i thought it 's diffcult to accurately spin up/down memory usage as manually.
发表于:2007-04-10 08:50:495楼 得分:20
cpu的控制好像是操作系统的任务
发表于:2007-04-10 09:13:206楼 得分:0
这个也太难了吧~
发表于:2007-04-10 23:33:087楼 得分:20
while(1){ int a =查看当前cpu使用率; if(a < 50){ // 50%使用率 //做一些纯消耗cpu的事情 } } 把上面代码放在一个线程里,运行这个线程就可以了吧