Application ‘Not Responding’ on Windows 7


Since moving to Windows 7 ultimate I have had occasional instances where some of my applications get flagged up as “Not Responding”.  I have also been asked about this several times over the last few weeks and a formal support request this morning prompted a discussion internally.  As a reminder to myself and for future reference, I thought that I’d write this blog posting.

If the offending application then tries running a long process (one that will run for more than 5 seconds, I believe), Windows 7 gets excited and reports the application as ‘not responding’.  This notification is normally through a discreet note at the top of the window and sometimes a more noticeable message asking whether to close the application or wait.

Fortunately, my OpenInsight 9.2.1 runs very quickly on my Windows 7 laptop and I don’t run into the issue too much.  However, if you (or your clients) are seeing this with your OpenInsight applications please keep the following in mind:

  1. The issue appears to be down to a process that is running (looping) for more than 5 seconds and Microsoft picks this up and flags it as a possible ‘non responding’ program and informs the user accordingly.  Despite the warnings, the process continues and the application usually gets flagged as responding again once the process has finished.  However, if you get the message popup on your screen and you click cancel, Windows 7 will try to terminate the application and this ‘could’ cause data loss or other nastiness.
  2. To manage your user’s expectations, simply make sure they are aware of this Windows 7 behavior and advise them to leave the application to run for a short while.
  3. Make sure that you are using one of the later versions of OpenInsight and the latest Universal Driver.  If configured correctly, this should ensure that your OpenInsight application is running as optimally as possible.  If in doubt, give me a call and book a health check wit hone of the developers.
  4. Most importantly, make sure that you code to address this Windows feature.  In OpenInsight, this can be as simple and easy as using a YIELD( ) within your programs that are likely to take any length of time (more than a few seconds).

Yield ( ) checks for pending events in the Windows event queue and executes them.  It then returns control as soon as the event queue is empty.  All pending events will be executed, including OpenInsight and Windows events.  It is therefore good practice to handle process dependent conditions (such as a CLOSE event0 after a Yield( ) call.

Example syntax for Yield ( ) is:

done = FALSE$
 Loop
 ReadNext ID Else done = TRUE$
 Until done
 * Allow for an event, such as CLICK
 Yield()
 * Process ID record
 Repeat

Legacy Applications
It is usually best to address this issue within your OpenInsight application and thereby maintain control.  However, for legacy systems there is another (which I would consider a last resort) option which makes use of Microsoft’s Application Compatibility Toolkit.  You can get further details about that by clicking here.

Advertisements

3 thoughts on “Application ‘Not Responding’ on Windows 7

  1. We’ve also found that setting the Compatibility Mode in the application’s shortcut properties to ‘Window XP (Service Pack 3)’ resolves this ‘Not Responding’ problem in Windows 7 – at least to the extent where Win7 disables the application and won’t show any visual progress info. We haven’t found any other side effects of doing this.

    Cheers, M@

  2. Mark Marsh

    Yield() in a loop does represent a significant Performance impact however. So its a good idea to only fire every n’th record.. n’th being a number you decide upon dependant on the processing your doing in the loop.
    The Mod() function is very useful for this sort of thing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s