Get the latest tech news

Windows Memory Mapped File IO


A blog about game engines, graphics, C++, and more.

IO completion ports on Windows aren’t so dissimilar from epoll and other analogous abstractions on other platforms that you couldn’t come up with a suitable cross-platform API covering it, but this is complexity I’d rather avoid at all costs if possible. If you wanted, you could support this type of thing in a Debug build configuration, as an additional form of validation, but I’ve found that the extra mapping doesn’t introduce much overhead and is generally worth it. Excessive flushing of file views and calls to FlushFileBuffers dramatically impact performance in the typical case, and regardless, it’s extremely impractical to guarantee that writes survive some catastrophe that interrupts the data pipeline flowing from RAM to hard storage.

Get the Android app

Or read this on Hacker News