▲ | jclarkcom 5 days ago | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Windows uses memory mapped IO for loading all executable processes because it allows you to start executing a process after loading a few pages even if the exe is megabytes. You can use the same to reduce latency for starting to assemble data before the rest of the file loads, the rest can be loaded using more efficienct asynchronous mechanisms. Using for output also means your process doesnt waits on flushes that is also async. And in memory constrained environments the OS doesn’t have to write your data to swap, it can just reload it from the meeting mapped file. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | Sesse__ 5 days ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Linux also uses mmap for running executables. But explicit I/O does not mean you have to start off by a gigabyte-long read(). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|