News for hackers. Stuff that matters.
Re:Mio – Cross-platform header-only C++11 library for memory... by ajross on Saturday October 20, 2018 @10:53AM (#18263530)
The code seems clean. I'm not sure this is a great idea in practice, though. Generally the only good reason for mapping stuff out of the filesystem is performance, and VM behavior with mmap() varies wildly across systems (and filesystem backends, and drivers if it's a hardware device, and hardware if it's a framebuffer, and...). Frankly on windows this is AFAIK a mostly-unheard-of technique. No one does mapping.

This just isn't really something that can be cleanly abstracted to do what you want it to do, even if you can make the code "look" the same.

But again, it looks like a nice, clean, modern C++ library. Just IMHO misapplied.

Re:Mio – Cross-platform header-only C++11 library for memory... by buckminster on Saturday October 20, 2018 @11:54AM (#18263823)
> Frankly on windows this is AFAIK a mostly-unheard-of technique. No one does mapping.

It's not that uncommon. Even notepad uses it:

https://blogs.msdn.microsoft.com/oldnewthing/20180521-00/?p=...

Re:Mio – Cross-platform header-only C++11 library for memory... by frutiger on Saturday October 20, 2018 @11:06AM (#18263588)
> Frankly on windows this is AFAIK a mostly-unheard-of technique. No one does mapping.

Just a data point, but we use memory mapping (both with and without names) in our product that runs on Windows.

Re:Mio – Cross-platform header-only C++11 library for memory... by xtrapolate on Saturday October 20, 2018 @12:10PM (#18263907)
> "Frankly on windows this is AFAIK a mostly-unheard-of technique. No one does mapping."

Unheared by you.

In a world consumed by Electron apps and Javascript, lots of people couldn't care any less about performant IPC, sharing data across processes, and multiprocessing in general.

Re:Mio – Cross-platform header-only C++11 library for memory... by vardump on Saturday October 20, 2018 @12:08PM (#18263895)
> Frankly on windows this is AFAIK a mostly-unheard-of technique. No one does mapping.

Really? Most larger (Windows) codebases I know of use memory mapping.

Re:Mio – Cross-platform header-only C++11 library for memory... by hyperman1 on Saturday October 20, 2018 @04:04PM (#18265134)
> Frankly on windows this is AFAIK a mostly-unheard-of technique. No one does mapping.

This must be incorrect.

Jeffrey Richter's advanced windows, a very widespread win32 book, introduced this technique to a LOT of developers, just when windows was the hot stuff for programmers. I don't think I've seen a win32 code base >100 Kloc without mapping. Understanding and using it is one of those rites of passage that marks the switch from junior to medior win32 developer.

Re:Mio – Cross-platform header-only C++11 library for memory... by chris_wot on Saturday October 20, 2018 @02:04PM (#18264546)
LibreOffice does quite a bit of memory mapping. So does everything else.
Re:Mio – Cross-platform header-only C++11 library for memory... by bsenftner on Saturday October 20, 2018 @01:19PM (#18264274)
MMapping is used in most fault tolerant software as a simplified method of data persistence. Granted, not the only method in play, but it is a common data safety net.
Re:Mio – Cross-platform header-only C++11 library for memory... by ajross on Saturday October 20, 2018 @02:11PM (#18264588)
Flushing behavior is precisely the kind of thing that varies the most between systems. I'd be very suspicious of a "fault tolerant" system that tried to use a library like this to be "cross platform". That's almost a contradiction in terms.
Re:Mio – Cross-platform header-only C++11 library for memory... by bsenftner on Saturday October 20, 2018 @03:21PM (#18264928)
Was not talking about that library, just memory mapped files.