How to easily use Kqueue in C language
This tutorial is designed for macOS or BSD systems. What is kqueue? kqueue is an event notification mechanism in macOS (and BSD systems such as FreeBSD). If you are writing a server, but you don’t want to allocate a thread for each client; you can use kqueue to listen for events from clients, for example: Who just connected? Who disconnected? Which client has sent a message? The system notifies you automatically. Multiple clients can be served by a single thread. This is I/O Multiplexing. kqueue is similar to epoll in Linux and iocp in Windows. This will save resources. ...