Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

XI. Alarms

GM provides the following simple alarm API. The alarm API allows the GM client to schedule a callback function to be called after a delay, specified in microseconds. An unbounded number of alarms may be set, although alarm overhead increases linearly in the number of set alarms, and the client must provide storage for each set alarm.

GM clients will also be able to take advantage of the fact that an application is guaranteed to receive a single GM_ALARM_EVENT for each call to a client-supplied callback, with the corresponding callback occurring during the call to gm_unknown() that processes that alarm. This means that a case statement like the following in the client's event loops can be used to significantly reduce the overhead of polling for any effect of a client supplied alarm callback:

     case GM_ALARM_EVENT:
       gm_unknown (event);
       /* poll for effect of alarm callbacks only here */
       break;


Generated on Mon Nov 3 15:39:27 2003 for GM by doxygen1.2.15