3 ms·
Isn't all this just an artifact of the file descriptor API? What would happen if programs could register callbacks to be called directly by the kernel in any of
by api 9y ago
Isn't all this just an artifact of the file descriptor API? What would happen if programs could register callbacks to be called directly by the kernel in any of N threads?
This would be a bit like signal driven I/O. I'm thinking nobody uses that because it's single threaded and antiquated.
- talideon 9y agoYou might be thinking of something not entirely unlike I/O completion portsL https://en.wikipedia.org/wiki/Input/output_completion_port https://en.wikipedia.org/wiki/Input/output_completion_port There's also kqueue/kevent, which came before epoll and which is arguably superior.
- Ded7xSEoPKYNsDd 9y agoWhat difference do you propose between "just call this function" and "just call this signal handler"? My feeling is that nobody uses signal driven I/O because signal handling is error prone and complicated. In fact, a very common pattern is to only set a flag in the signal handler, which is checked at defined points in the main program... not completely dissimilar from doing non-blocking calls at defined points in the main program.