Synchronizing Asynchronous Events: Work Loops

Synchronization within a driver becomes difficult if the driver needs to respond to asynchronous events such as hardware interrupts or timers. This adds an extra layer of complexity since, in addition to requiring synchronization between multiple threads of execution, the driver now has to contend with the synchronization of code that runs on multiple threads and code that runs in response to asynchronous events. To simplify the work required by the driver developer, the I/O Kit provides a class known as IOWorkLoop that creates a single thread on which all asynchronous events are handled. In I/O Kit nomenclature, this thread is known as a “work loop” and a driver registers any of its asynchronous ...

Get OS X and iOS Kernel Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.