First nitpick: static int pipe_fd[2] = {0}; 0 is valid fd, so I recommend initializing fds to -1. signalfd was just off-hand mentioned, but for writing anything larger, like lets say a daemon process, it keeps things…
This is getting into taste territory but sure just getting the signal in epoll_pwait removes the need for FD reading. But introduces the need for the thread local global context and the need to handle EINTR from epoll…
I have to disagree here. Not recommending signalfd for the mentioned use cases might be reasonable, just as reasonable as it is to use threads for a specific use case. For a single threaded non-blocking-FD using…
Just skimmed through the article, since I'm just here to testify that the most important revelation for me on writing APIs was that you can put and epoll_fd in an epoll_fd. This allows the API to have e.g. a single…
This is why I opted for Shelly on my house build. The dimmers keep dimming and everything works regularly without a hub/HA/Wifi. Leaving the modules inside the light switches. No need for special bulbs and having…
First nitpick: static int pipe_fd[2] = {0}; 0 is valid fd, so I recommend initializing fds to -1. signalfd was just off-hand mentioned, but for writing anything larger, like lets say a daemon process, it keeps things…
This is getting into taste territory but sure just getting the signal in epoll_pwait removes the need for FD reading. But introduces the need for the thread local global context and the need to handle EINTR from epoll…
I have to disagree here. Not recommending signalfd for the mentioned use cases might be reasonable, just as reasonable as it is to use threads for a specific use case. For a single threaded non-blocking-FD using…
Just skimmed through the article, since I'm just here to testify that the most important revelation for me on writing APIs was that you can put and epoll_fd in an epoll_fd. This allows the API to have e.g. a single…
This is why I opted for Shelly on my house build. The dimmers keep dimming and everything works regularly without a hub/HA/Wifi. Leaving the modules inside the light switches. No need for special bulbs and having…