-
Mar 27th, 2023, 03:23 PM
#1
Thread Starter
Hyperactive Member
[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
-
Mar 27th, 2023, 03:58 PM
#2
Re: form1 becomes non responsive
 Originally Posted by georgesutfin
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?
-
Mar 27th, 2023, 04:04 PM
#3
Thread Starter
Hyperactive Member
Re: form1 becomes non responsive
My code for playing baccarat is 925 lines long what part do you want to see? All of it?
-
Mar 27th, 2023, 04:32 PM
#4
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
 
-
Mar 27th, 2023, 07:45 PM
#5
Re: form1 becomes non responsive
 Originally Posted by georgesutfin
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.
-
Mar 28th, 2023, 02:25 PM
#6
Thread Starter
Hyperactive Member
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
-
Mar 28th, 2023, 04:17 PM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|