Is Your Code Laptop-Ready?

A number of the programs that I have running on my pc have a problem with stand by. When I open the lid of my laptop, I often get a greeting expcetion in a message box.
By keeping memory alive and asking all device drivers to resume state, your operating system is trying to create an abstraction that allows your app to work regardless. While this works for most apps, the abstraction is not complete and there are a number of quirks you should prepare your code for:

  • Networks may change. The IP of this machine may not be the same as when the program was started.
  • In fact, the entire hardware configuration may have changed. Most obvious example is the docking station that adds memory or pci slots.
  • Time is non-linear. From your app’s point of view, stand by is the equivalent of time travelling. Four hours may have passed since the last tick because of stand by.


Leave a Reply

-->