kqueue client code, manually relaxing the signal mask for just the single kevent() call waiting for new events.
https://media.bsd.cafe/bsdmmedia01/media_attachments/files/114/319/100/751/970/447/original/2f5c4626b51468ee.png
First change since #swad 0.2 will actually be a (huge?) improvement to my #poser lib. So far, it was hardwired to use the good old #POSIX #select call. This is perfectly fine for handling around up to 100 (or at least less than 1000, YMMV) clients.
Some #select implementations offer defining the upper limit for checked file descriptors. Added support for that.
POSIX also specifies #poll, which has very similar #scalability issues, but slightly different. Added support for this as well.
And then, I went on to add support for the #Linux-specific #epoll and #BSD-specific #kqueue (#FreeBSD, #NetBSD, #OpenBSD, ...) which are both designed to *solve* any scalability issues 🥳
A little thing that slightly annoyed me about kqueue was that there's no support for temporarily changing the signal mask, so I had to do the silly dance shown in the screenshot. OTOH, it offers changing event filters and getting events in a single call, which I might try to even further optimize ... 😎
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.