|
|
|
|
|
by amelius
1979 days ago
|
|
> It is incompatible with non-blocking I/O since your process will be stopped if it tries to access part of the file that is not mapped Yeah, but the same problem occurs in normal memory when the OS has swapped out the page. So perhaps non-blocking I/O (and cooperative multitasking) is the problem here. |
|
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.)