1 / 16

Events in General

Events in General. Agenda. Post/wait technique I/O multiplexing Asynchronous I/O Signal-driven I/O Database events Publish/subscribe model Local vs. distributed events. Post/wait technique. Operating systems and some DBMSes Wait for an event to happen

dsanborn
Télécharger la présentation

Events in General

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Events in General

  2. Agenda • Post/wait technique • I/O multiplexing • Asynchronous I/O • Signal-driven I/O • Database events • Publish/subscribe model • Local vs. distributed events

  3. Post/wait technique • Operating systems and some DBMSes • Wait for an event to happen • Post an event; i.e., make it happen • Problems • multiple listeners not usually possible • waiting for different types of events not possible without multiple threads • posting before waiting/waiting for non-event

  4. Quick Review User Space System Call Data Transfer Kernel Space Device I/O Char/Block transfer Hardware

  5. Blocking and Non-blocking I/O • Blocking • send request and wait for completion • Non-blocking • send request and check later for completion • Check later: • periodically (polling) • occasionally • deferred wait

  6. I/O Multiplexing • Unix select() kernel function • Send I/O requests and continue executing • Wait for one or more of multiple events • and/or a timeout to occur • events are read, write or exception • kernel notifies caller when I/O initiates • Demultiplex event and handle it • handler copies data from kernel space to user space

  7. Asynchronous I/O • Register handler function, send I/O request to kernel and continue executing • Kernel notifies handler function • after I/O has completed • kernel copies data from kernel space to user space • Not really in most Unixes • it’s a POSIX thing

  8. Signal-driven I/O • Register handler function for signal, send I/O request and continue executing • Kernel notifies (signals) handler function • after I/O has initiated • Handler copies data from kernel space to user space

  9. Database Events • InterBase’s mechanism • Post/wait technique • Named events • Applications can register for multiple events • synchronous or asynchronous • Events under transaction control • Multiple postings of same event yields only one event

  10. Publish/Subscribe Model • Interested parties subscribe to service • consumers (listeners) • Publisher of service provides information • supplier (source) • Push: send out information • Pull: request information • Java Event Model: • supplier pushes GUI events to consumer

  11. Event Channels • Familiar push model: one-to-many • Channels allow: • push or pull • many-to-many Consumer 1 Supplier 1 Channel Consumer 2 Supplier 2 Consumer 3

  12. Event Channels: Advantages • Multiple suppliers and multiple consumers • Could: • buffer incoming events for later delivery • ensure quality of service • hide communication models • filter events • route events • make events persist

  13. Local vs. Distributed Events • Most event models don’t consider distribution • Why is this? • Industry solutions: • CORBA • ACE

  14. Blocking I/O Example

  15. Non-blocking I/O (Poll) Example

  16. Non-blocking I/O (Select) Example

More Related