|
-
Jan 3rd, 2004, 11:16 PM
#1
Thread Starter
Addicted Member
Does anyone know any code that will lock up a machine?
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.
-
Jan 4th, 2004, 12:02 AM
#2
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.
Last edited by randem; Jan 4th, 2004 at 11:28 AM.
-
Jan 4th, 2004, 11:19 AM
#3
Fanatic Member
hmm
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
-
Jan 5th, 2004, 03:07 PM
#4
Thread Starter
Addicted Member
OK, good ideas.
Now, would anyone know what API check's the processor usage?
-b-
-
Jan 5th, 2004, 03:10 PM
#5
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
-
Jan 5th, 2004, 03:14 PM
#6
Thread Starter
Addicted Member
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.
-
Jan 5th, 2004, 03:23 PM
#7
brandoom
That sounds like your server portion should be monitoring itself and not letting this situation happen in the first place.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|