Results 1 to 7 of 7

Thread: [RESOLVED] form1 becomes non responsive

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2013
    Posts
    478

    Resolved [RESOLVED] form1 becomes non responsive

    Hello
    I am running 100 shoes of baccarat, I have the ability to set the seed for the rng thus I am able to repeat a given group of 100. Sometimes everything goes as it should. Other times at different places the form1 becomes nonresponsive and the screen stops updating. After a while, the screen does respond showing all the loops have finished and record keeping is updated. Am I overloading the video? Stuck in some form of garbage collection? I am reasonably sure the problem is not in my code.
    TIA
    George

  2. #2
    PowerPoster
    Join Date
    Nov 2017
    Posts
    2,535

    Re: form1 becomes non responsive

    Quote Originally Posted by georgesutfin View Post
    Hello
    I am running 100 shoes of baccarat, I have the ability to set the seed for the rng thus I am able to repeat a given group of 100. Sometimes everything goes as it should. Other times at different places the form1 becomes nonresponsive and the screen stops updating. After a while, the screen does respond showing all the loops have finished and record keeping is updated. Am I overloading the video? Stuck in some form of garbage collection? I am reasonably sure the problem is not in my code.
    TIA
    George
    How would we know the answer to any of those questions without seeing your code?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2013
    Posts
    478

    Re: form1 becomes non responsive

    My code for playing baccarat is 925 lines long what part do you want to see? All of it?

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,275

    Re: form1 becomes non responsive

    If the form becomes non-responsive, video is VERY unlikely to be the issue, and garbage collection is fairly unlikely. If video was unresponsive, you'd likely see a black, white, or garbled screen. GC could freeze the program, but likely only for a second or less. A stutter, nothing more.

    So, what is happening is that something is occupying the UI thread for an unreasonable length of time. If it were a perpetual loop, then it would never recover. If it were perpetual recursion, then it would crash. Since neither of those two are happening, it is something else.

    Assuming that this is running in the IDE in a debug session, the first thing I would do would be to run it until one of those freezes, then hit pause (or break, or whatever you want to call it). I'd do that a few different times and see where execution stopped. However, when that happened, I'd then hit F11. If the execution pointer steps forwards one line, then you are in a very long running loop. If the pointer does not step forwards, then it is something more interesting.

    By doing this a couple times, you will probably find that when the program breaks, it stops in the same loop. That loop is the problem, one way or another, so that's likely all that matters.
    My usual boring signature: Nothing

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    109,603

    Re: form1 becomes non responsive

    Quote Originally Posted by georgesutfin View Post
    My code for playing baccarat is 925 lines long what part do you want to see? All of it?
    No, just the part relevant to the issue. You have a debugger at your disposal so you need to use it to narrow it down. You need to work out where the code is up to when these freezes happen. You can use the debugger or you can add logging code but you need to do some actual development work.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2013
    Posts
    478

    Re: form1 becomes non responsive

    Thank You all for your input!
    I have been unable to recreate the problem! I made no changes to the code and did not reload the program. Yesterday my computer sounded like it was drawing a lot of power. Today quiet as a mouse.
    Thanks again
    George

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,275

    Re: [RESOLVED] form1 becomes non responsive

    It probably was. That's actually a pretty good clue, even though the problem has gone away. If the computer is just waiting for something, that uses almost no power. If the computer is stuck in a loop, then the power consumption can rise dramatically, which causes an increase in heat, which results in all the fans ramping up to shed the excess heat. That's the noise. Therefore, it was a loop that was likely causing you trouble, though which one you can only find through breaking while in the delay.
    My usual boring signature: Nothing

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