|
|
|
|
|
by loeg
1979 days ago
|
|
> Yeah, but the same problem occurs in normal memory when the OS has swapped out the page. I'd argue that swapping is an orthogonal problem which can be solved in a number of ways: disable swap at the OS level, mlock() in the application, maybe others. mmap is really a bad API for IO — it hides synchronous IO and doesn't produce useful error statuses at access. > So perhaps non-blocking I/O (and cooperative multitasking) is the problem here. I'm not sure how non-blocking IO is "the problem." It's something Windows has had forever, and unix-y platforms have wanted for quite a long time. (Long history of poll, epoll, kqueue, aio, and now io_uring.) |
|
You can trap IO errors if necessary. E.g. you can raise signals just like segfaults generate signals.
> I'm not sure how non-blocking IO is "the problem."
The point is that non-blocking IO wants to abstract away the hardware, but the abstraction is leaky. Most programs which use non-blocking IO actualy want to implement multitasking without relying threads. But that turns out to be the wrong approach.