I'm trying to cause the computer to lockup, without creating an endless loop.
I'm writing a program that will try to shut down a process that has pegged the CPU. I don't want my program's process to peg the CPU though, for testing purposes.
Printable View
I'm trying to cause the computer to lockup, without creating an endless loop.
I'm writing a program that will try to shut down a process that has pegged the CPU. I don't want my program's process to peg the CPU though, for testing purposes.
brandoom
Create a seperate program (exe) with a tight loop that takes a long time and have your program execute it, then attempt to kill it.
set the priority of a testing program to highest. then create a form vbmodal, have it load several rather large text files, line per line with no doevents between each line read.
should spike cpu proccess to above normal
also CMD (Dos based programs use up 100% cpu cycles when in full screen mode
OK, good ideas.
Now, would anyone know what API check's the processor usage?
-b-
is this app you are making to kill ANY process that pegs the CPU?? because some are supposed to, and others do when first loading... these are common things, and newer windows versions, like 2000 and XP do a pretty good job of handling this already
Yes, I've written a rather complex program that starts and monitors BF1942.EXE game servers. The program is also a server application that can connect many clients. It performs all kinds of socket operations, retrieves data from the BF1942 server via 2 seperate network protocols and performs it's own auto-administration functions. It has all kinds of timers and loops in it. The BF1942.EXE server that it monitors and manages is also very buggy, so while it's rare, it's possible that the BF1942 server crashes and can cause my program to hang. I basically want to write a mini little Firedaemon application that check the process of my server manager about every 10 seconds. If it's pegged the CPU o anything over 50%, then I'll check it again in 5 seconds, if it's still pegged, I'll kill the process and launch it again.
I need a quick way to check the Processor Usage, most preferrable by passing the PID to the function.
Thanks.
brandoom
That sounds like your server portion should be monitoring itself and not letting this situation happen in the first place.