LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to set mximum allowed CPU time for a process ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-mximum-allowed-cpu-time-for-a-process-701763/)

terminatorul 02-02-2009 06:30 PM

How to set mximum allowed CPU time for a process ?
 
Hello

I am trying to play Heroes Of Might and Magic III (under wine) and after some hours of play my system just rebooted.

I looked for the CPU temp and it was 46 °C.
I know this game uses 100% CPU time, even though it gets more FPS than needed, and I think it over-heats my system.

Is there a way to tell my system that process 3851 can only have 25% CPU time and no more (like the task scheduler to suspend it 10 times per second for 75ms each and only let it run 25ms) ?

Simply setting the process to low priority would not help.

I think it would not be complicated to write a program that suspends and resumes a process many times per second, as long as you know the API. Has anyone had a need for something like this before ?


I have (Slackware) Linux 2.6.24 i686 AMD Sempron.

Thank you,
Timothy Madden

syg00 02-04-2009 04:25 AM

Have a look at containers (cgroups).
Documented in the source tree.

ilikejam 02-04-2009 04:28 AM

Hi.

46°C isn't hot. To be honest, it's not even warm for a modern processor. As a data point, my Athlon box runs at about 45 degrees at idle, and can get up to 65 under load.
I'd be more inclined to think that you've got some dodgy RAM, or a failing power supply.

Dave

terminatorul 02-05-2009 06:27 PM

Thank you for your answers.

How am I supposed to use cgroups ? There is no such command ...
I thought 46 deg. C are not much, but then again during the time my system rebooted, twice, maybe the cooler did its job.
And anyway Heroes III does take up 100% CPU time, as system information shows me, and I had no way to stop it.

Thank you,
Timothy Madden


All times are GMT -5. The time now is 11:14 AM.