![]() |
Three Types of Event LoopsBy Travis Bogard
Last Modified: 8-31-99 In designing this code we identified three types of event loops that are often found in an application. The distinction/ implementation of each may be the same across some of them for the different types depending upon the platform, but from a conceptual point of view we came up with three event loop types:
AppBreathLoop - This is a loop commonly put in various places through out the client code to allow processing of native events from some position up the stack. In the windows world commonly implemented using a PeekMessage loop, on other platforms it may be a yield of some kind or actually processing/ dispatching the real main events. The actual usage of these can be plagued with problems depending upon design because of re-entrancy, but there are places that do legitimately need them and thus we will provide the functionality in an XP fashion. There can be any number of these types of loops. These also differ from the other two loops in that loops of this kind return once it has relinquished control to the OS and other apps for a while. Where as the other loops run until they are complete because of a desire to exit the loop. |
|
|
Copyright © 1998-1999 The Mozilla Organization.
Last modified September 2, 1999. |
|