Page 120 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 120
Introduction to Microprocessors
Notes Events may or may not be interruptive. If not interruptive, they may be read in a
• blocking
• non-blocking
8.2.7 Event Queues
• Device is monitored by an asynchronous process.
• Upon change in status of device, this process places a record into an event queue.
• Application can request read-out of queue:
– Number of events
– 1st waiting event
– Highest priority event
– 1st event of some category
– All events
• Application can also
– Specify which events should be placed in queue
– Clear and reset the queue etc.
• Queue reading may be blocking or non-blocking
• Processing may be through callbacks
• Events may be processed interactively
• Events can be associated with more than devices
Without interrupts, the application will engage in an event loop
• not a tight loop
• a preliminary of register event actions followed by a repetition of test for event actions.
For more sophisticated queue management,
• application merely registers event-process pairs
• queue manager does all the rest
if event XXX then invoke process YYY.’’
• The cursor is usually bound to a pair of valuators, typically MOUSE_X and MOUSE_Y.
• Events can be restricted to particular areas of the screen, based on the cursor position.
• Events can be very general or specific:
– A mouse button or keyboard key is depressed.
– A mouse button or keyboard key is released.
– The cursor enters a window.
– The cursor has moved more than a certain amount.
– An Expose event is triggered under X when a window becomes visible.
– A Configure event is triggered when a window is resized.
– A timer event may occur after a certain interval.
114 LOVELY PROFESSIONAL UNIVERSITY