Source language: Translate to:

High compute load causes a "Not Responding" window

General questions about NeoBook

Moderator: Neosoft Support

High compute load causes a "Not Responding" window

Postby Enigman » Thu Sep 11, 2014 11:20 pm

I have noticed that in virtually all of my NeoBook apps, if the script code has a section with a loop, and that loop does intensive operations, then the pub window is duplicated with a five pixel offset from the original, and the top "fake" window is labeled as "Not Responding". You can actually grab the two windows and move them around separately on the screen. See this screen shot taken during run time of the loop:

Image

As soon as the script loop terminates, then the top window disappears.

Has anyone also noticed this behavior? This has to be an issue with interaction with Windows where Windows thinks it can no longer reach the app, but why create a false ghost of the app window?

Anyone know how to prevent this?

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: High compute load causes a "Not Responding" window

Postby Tony Kroos » Thu Sep 11, 2014 11:29 pm

Interesting bug, didn't ever notice it ) Can you provide sample script to reproduce this bug? )
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Re: High compute load causes a "Not Responding" window

Postby Enigman » Thu Sep 11, 2014 11:43 pm

Tony Kroos wrote:Interesting bug, didn't ever notice it ) Can you provide sample script to reproduce this bug? )

Sorry. Anything short of the full pub file would not work or be useful, and I cannot publish the pubs because they are either personal data related, or security related, or an unreleased commercial product.

But, it isn't too hard to duplicate. I am using loops to process Access databases with dbPro. I run through the records and manipulate the data, write out flat files, etc. The loops have disk I/O, database record changes, substring substitutions, math, a lot of "If Then Else" logic, etc. Anything over about 10 iterations of any such loop does it.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: High compute load causes a "Not Responding" window

Postby Rodrigo » Fri Sep 12, 2014 6:10 pm

I do not know the exact cause, but I have solved with a trick.

Have you tried adding a pause (delay) after each loop?

Code: Select all
Loop "1" "[top]" "[x]"
    .A lot of code
    Delay "20"
EndLoop


this works for me.
After the game, the nerd and the ignorant will return to the same box
User avatar
Rodrigo
 
Posts: 29
Joined: Wed May 30, 2012 6:23 am
Location: Chile

Re: High compute load causes a "Not Responding" window

Postby Enigman » Fri Sep 12, 2014 9:25 pm

Rodrigo,

As ironic timing would have it, in the process of adding some new functions, I have discovered that two things contributed to the problem. One, probably the greater of the two, was the "Suspend" command. The other as you have discovered as well, was the "lack" of a "Delay" in the loop.

Just before I started the loop processing I issued a Suspend "true" command to stop the user from starting anything else during processing. Once the loop began to execute, Windows could no longer get a response from the program until the loop completed, causing the "Not responding". This was particularly acute if the user tried to click anything during loop processing.

Today I was working on adding an abort dialog that comes up while the loop is processing to allow the user to abort the process. The idea was to open the dialog just as the script is entering the loop. What happened was that with the suspend in place, the dialog failed to open until the loop completed and suspend was turned off. In order to fix that, I added a Delay of 100 right after the command to open the dialog. That allowed the dialog to open, but with suspend in place the user could not click the dialog. So I commented out the suspend. Now the dialog would open, and there was no "Not Responding", but clicking the dialog could not get the loops attention, and the click launched the "Not Responding". Last but not least, just before I checked for an abort click inside the loop, I added another Delay 100. That made everything work, and no more "Not Responding" since the delay in the loop let Windows in the door when needed.

So yes, thank you, a Delay does stop the problem, as well as not having a suspend in effect.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest