16kqueue and FSEvents
Several of the technologies you have seen so far date back to Unix’s earlier days. Some of the APIs are awkward and difficult to use correctly, such as signal handling, and some are awkward and do not scale well, such as select() and poll().
In 2000, the FreeBSD project created Kernel Queues, abbreviated as “kqueues,” to address the shortcomings in the older APIs. Apple adopted kqueues in Mac OS X 10.3 and extended them in 10.6. kqueues are a unified notification mechanism used by the kernel that can inform your program about interesting events.
Inside the kernel are a number of filters, as shown in Figure 16.1. As the kernel does its work, it tells the filters what’s going on. There is a filter for process handling, another ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access