Hard Light Productions Forums
Off-Topic Discussion => General Discussion => Topic started by: kasperl on March 20, 2005, 04:52:40 am
-
I'm running a DOS app I wrote myself in QuickBasic under WinXP Home, and the thing will use 100% of the CPU when active, even if it's just waiting. This is on a laptop with something like Cool&Quiet, but while running this app, the computer is cool nor quiet. I can use the computer normally if I lower the processes priority, but I was hoping for a way to limit the percentage of processor cycles that a process can use.
Any way to do this without switching to Linux?
-
Bumpage......
Any idea's at all?
-
ah. a unix nice cmd :P
-
Isn't a 'lower process priority" thing in the task manager process list?
If not, try Process Explorer.
-
Prio won't help if there isn't anything else eating up the cycles.
-
I dunno. My system Idle Process seems to use up all of my cycles. ;)
-
That's percentage of used cycles you're seeing. You need to check 'prestations' (middle tab) (Dutch windows sucks), to see percentage CPU used.
-
What does the qbasic program actually do?
It isn't waiting for an IO, is it? :p
-
Actually, it is.
EDIT: Couldnt tell if that was sarcasm, or mocking. So it isnt my fault if I look like a jackass :p.
-
AAAAAAHHHHH. Forget about renicing an IO process that is stuck. Kill it and debug.
-
It is not stuck, it's waiting for me to think of the right answer.
(I use it to revise vocabulary and stuff. It'll output some word, and I have to give a translation, it'll check for correctness, ask the wrong answers again, all neatly randomized and stuff. It'lll even keep score.
If it's waiting for a keypress the system will damn nearly die, but if it's waiting for an input (terminated string), it'll just get the processor really hot.)
And little to no way for me to debug that code, I wrote it a few years ago, it's over 1100 lines, with only GOTO and the most basic loops. And no comments.
-
It is odd that the program takes all the cpu if it's just waiting for an input.
Anyway, you could time the input and if n seconds passes, exit.
I believe it can be done.
-
You could just limit the entire CPU by using something like SpeedswitchXP (http://www.diefer.de/speedswitchxp/), but that'd only work if other apps you're running at the same time don't need much processor power.
-
Originally posted by mrduckman
It is odd that the program takes all the cpu if it's just waiting for an input.
Anyway, you could time the input and if n seconds passes, exit.
I believe it can be done.
1) It's made for DOS
2) I'm using the SLEEP command, meaning 'wait for a keypress, and the continue'
3) It'd be bloody near impossible to use a timer there, since I need the user to confirm seeing the results.
4) AFAIK the thing goes like this:
while(keypress!=anything)
{get keypress;}
So yeah, it'd eat up a lot of juice.