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:
- 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.
- 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.
- 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.
- 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.