Some papers on GHC runtime internals mention that it uses epoll/kqueue/poll to detect whether a file descriptor is ready to read/write.
I can understand how it's done for socket I/O. But what about disk file access? The poll syscall doesn't work with ordinary files, only with socket I/O; true?
The only option I can imagine here is using a thread pool for blocking syscalls, one thread-per-request...
In the unthreaded RTS, the whole runtime will block. In the threaded RTS, it will do safe foreign calls like this via thread pool, so the capability will not block.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With