Posted by: Anonymous Coward
on March 31, 2005 05:53 AM
I write lots of TCL code to test firmware. One of the toughest problems we face is timing of events. My tendency is to use a hard-coded sleep. The problem with using a wait is that the blocking process might hang. In my environment, I'd rather risk prematurely returning than to hang a process until someone notices the lack of activity.
I often write a looping routine that takes a time-out value as a parameter, and then poll the forked process within the routine with a short sleep in between the polls to minimize the impact on the CPU.
If the process returns before the timeout value, no error is thrown. If the process times-out, the devices gets a reset, and the script gracefully records the time-out.
Infinite loop problem
Posted by: Anonymous Coward on March 31, 2005 05:53 AMI often write a looping routine that takes a time-out value as a parameter, and then poll the forked process within the routine with a short sleep in between the polls to minimize the impact on the CPU.
If the process returns before the timeout value, no error is thrown. If the process times-out, the devices gets a reset, and the script gracefully records the time-out.
#