Results 1 to 7 of 7

Thread: Does anyone know any code that will lock up a machine?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2002
    Posts
    196

    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.
    Brandon S Davids

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385
    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.

  3. #3
    Fanatic Member TokersBall_CDXX's Avatar
    Join Date
    Mar 2003
    Location
    America
    Posts
    571

    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
    Build your own personalized flash based chat room for your webpage for FREE! http://www.4computerheaven.com

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2002
    Posts
    196
    OK, good ideas.

    Now, would anyone know what API check's the processor usage?


    -b-
    Brandon S Davids

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    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

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Dec 2002
    Posts
    196
    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.
    Brandon S Davids

  7. #7
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385
    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
  •  



Click Here to Expand Forum to Full Width