|
Question Do threads calling the event delivery mechanism go into a wait pool?
I've got a question about the event-delivery mechanism in MIDP. According to the specification, the methods are called serially, that is, one after the other, with events "queueing up" to be dealt with. Does this mean that the threads calling the event delivery methods go into a wait pool until the previous method has returned? If so, is there a limit to how many events can be waiting? The Tip
There is actually just one thread servicing events. This is the "main" or "event" thread for the application. All event callbacks (calls to
Follow-up question: But if the coalescing applies to Follow-up tip: Paint events are coalesced by taking the union of the paint are as, which is generalized to mean the minimal rectangle that contains the entire set of paint areas. And yes, this can lead to repainting parts of the screen that don't need to be repainted. Implementations that support double-buffering (painting to an off-screen area and then copying the resulting bitmap directly onto the screen in a single operation) minimize the flashing caused by excessive repainting. Note, however, that paint coalescing doesn't have to take place -- it really depends on the implementation. The implementation could choose to keep individual paint events as they are. However, given the fact that many applications just blindly repaint the entire screen it's usually better for coalescing to occur. There are always tradeoffs.... BTW, none of this is really specific to MIDP. Any event-based GUI system has the same issues and does similar things. Some implementations actually coalesce paint events into true unions, that is, non-rectangular paint areas. AWT in J2SE 1.3 now does this, for example, see http://java.sun.com/j2se/1.3/docs/guide/awt/ for details. Acknowledgments Many thanks to Eric Giguere for contributing to this answer.
| |||||||||||||||||||||||||||||
|
| ||||||||||||