Skip to content

Glossary

IOInterruptDispatchSource

IOKit's abstraction for an interrupt source. Registers a top-half filter with the kernel and dispatches the bottom-half action onto the driver's workloop.

An IOInterruptDispatchSource is the IOKit object that bridges a hardware interrupt to a driver callback. It encapsulates:

  • A filter — runs in top-half (interrupt) context. Acknowledges the device, masks the source, decides whether it's worth scheduling the bottom-half.
  • An action — runs in bottom-half context on the driver's workloop. Does the real work: copy buffers, update queues, wake waiters.
apple-oss-distributions/xnuiokit/Kernel/IOInterruptEventSource.cppThe classic in-kernel interrupt event source — DispatchSource is its modern evolution.View on GitHub(line )

When the hardware fires, the kernel's interrupt handler calls the filter (top-half), which returns whether to schedule the action. If yes, the action is enqueued on the workloop; the workloop's thread wakes and calls it.

DriverKit dexts use the same abstraction, but the action runs on a GCD dispatch queue in the userspace dext process instead of on a kernel workloop. The kernel-side filter runs in the kernel and sends a Mach message to the dext to schedule the action — a few microseconds of extra latency for crash isolation.

See also: IOWorkLoop, DriverKit, and the interrupt handling article.