I recall tedu@ saying my that there was no reason for there to be multiple kqueues in a program. Well I beg to differ.
I have a program with 3 kqueues because I want three distinct priorities on each worker process. The parent program initializes and fork()s a process that listens and passes internet sockets to one of the worker processes which is the last worker kqueue priority. I want the workers to operate upon the socket upload and download operations within the already received internet sockets (memory and limited stalling or latency permitting) before accepting new internet sockets. This is the second kqueue priority. There are a couple other fork()ed processes; I’m not going into the weeds into why (it’s dealing with a patented process dealing with multiple clients interacting on the same data in the server), all the worker processes are socket connected to the two other processes. The first process receives data from the workers and manages timeout periods and the second receives data from the first process and sends back data to be processed back to the workers to indicate that a socket transaction is complete or otherwise needs to be terminated and I want that procedure to be completed without interruption by other kqueue events. This is the first priority. To do this at this point, I have to have what I call “the backbone” to jump around between a bunch of different kevent calls to mediate all of these distinct kqueues where each priority must be exhausted before the next priority should be dealt with. At the very least the second and third priorities need to be distinct to prevent session memory from exploding from the creation of new connections while nothing gets done on existing sockets. I suspect this is something that would be very useful to other systems. Maybe my program is a unique case which doesn’t deserve any attention, but perhaps I’m not the only one who could benefit from this…eh?!!! Or is FreeBSD the OpenBSD upstream on kqueue/kevent ? By the way, whoever unlocked kevent in -current, AMAZING!!!! -- -Luke