kqueue
A general-purpose, high-performance event notification framework provided by BSD and macOS kernels. More abstract and versatile in design than epoll, it can monitor multiple event types including sockets, files, signals, and processes, implemented through the kqueue and kevent system calls.
Timeline (last 90 days)
libevent wraps epoll on Linux, kqueue on BSD/macOS, uses /dev/poll or event ports on Solaris, and uses select or IOCP on Windows, and externally provides a unified event_base event loop interface.
kqueue is an event notification mechanism on BSD/macOS, featuring a filter mechanism.
The Watched Folders feature technically relies on file system event notification mechanisms provided by macOS, such as FSEvents or kqueue, without requiring the app to continuously poll the disk.
kqueue originated in FreeBSD and works through two system calls, kqueue and kevent, with kevent handling both registration and event retrieval
epoll and kqueue follow the same philosophy: register once and wait multiple times, return only active events, and let the kernel proactively notify, making it possible for a single machine to support millions of concurrent connections
kqueue distinguishes event types via the filter field of the kevent struct, such as EVFILT_READ/WRITE, EVFILT_VNODE, EVFILT_PROC, EVFILT_SIGNAL, and EVFILT_TIMER, allowing unified handling of socket reads/writes, file changes, process state, signals, and timers
FSEvents and Grand Central Dispatch on macOS, as well as the BSD/macOS platform implementation of libuv, are all built on top of kqueue
All Facts (7)
libevent wraps epoll on Linux, kqueue on BSD/macOS, uses /dev/poll or event ports on Solaris, and uses select or IOCP on Windows, and externally provides a unified event_base event loop interface.
50%Unverifiedkqueue is an event notification mechanism on BSD/macOS, featuring a filter mechanism.
50%UnverifiedThe Watched Folders feature technically relies on file system event notification mechanisms provided by macOS, such as FSEvents or kqueue, without requiring the app to continuously poll the disk.
50%Unverifiedkqueue originated in FreeBSD and works through two system calls, kqueue and kevent, with kevent handling both registration and event retrieval
50%Unverifiedepoll and kqueue follow the same philosophy: register once and wait multiple times, return only active events, and let the kernel proactively notify, making it possible for a single machine to support millions of concurrent connections
50%Unverifiedkqueue distinguishes event types via the filter field of the kevent struct, such as EVFILT_READ/WRITE, EVFILT_VNODE, EVFILT_PROC, EVFILT_SIGNAL, and EVFILT_TIMER, allowing unified handling of socket reads/writes, file changes, process state, signals, and timers
50%UnverifiedFSEvents and Grand Central Dispatch on macOS, as well as the BSD/macOS platform implementation of libuv, are all built on top of kqueue
50%