Clem Cole wrote in
<CAC20D2PfMx=tox0NmLYCi_7345BSr8yoCQZTRVspS8YxAawYdg(a)mail.gmail.com>:
|On Mon, Dec 16, 2024 at 10:40 AM Douglas McIlroy <
|douglas.mcilroy(a)dartmouth.edu> wrote:
|
|>>> Does anyone know whether there are implementations of mmap that
|>>> do transparent file sharing? It seems to me that should be possible by
|>>> making the buffer cache share pages with mmapping processes.
|>
|>> These days they all do. The POSIX rationale says:
|>
|>> ... When multiple processes map the same memory object, they can
|>> share access to the underlying data.
|>
|> Notice the weasel word "can". It is not guaranteed that they will do so
|> automatically without delay. Apparently each process may have a physical\
|> ly
|> distinct copy of the data, not shared access to a single location.
|>
|Hmmm — how did that make it through the IEEE editing process? However, that
|is not part of the standard if it's in the Rationale - just an explanation
|of the standard - which I want want look at more carefully to see what it
|says about what is required of mmap(2).
|
|That said, as Heinz and the rest of us who worked on the original version
|of what would come to POSIX can tell you, the word "can" was always a
|no-no. The word "SHALL" is the the official IEEE word, and if you use
|"SHOULD," even in the rationale and it was very much frowned upon.
I'll
They are all lowercase nowadays.
|have try dig up the troff sources to an early draft of the original and do
|a "grep -i should * | wc -l" through it. I bet the number is very small
|and "can" is zero.
They offer lots of hints like "can be implemented efficiently" or
"conforming implementations cannot count on", which turns "can"
into a "dying butterfly". (In the rationale's.)
|That said, it has been a few years since I have read a current draft, but
|less the rationale section (which is not the standard itself).
The 2024 version is 4057 pages, all in all. It would -- in my
opinion -- make a nice discussion whether it would be better for
anybody, including engineers, to take the time to read that amount
of cultural foundation, real literature that is, instead of
a technical standard. (I admit i personally perform standard
hopping and have at times some spare time for other things,
because if i fail it currently endangers noone for one, and when
i fall i stand up anyway, unless i do no more, but then having
lived in mindsets++ of fantastic literats.)
|Clem
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
|
|And in Fall, feel "The Dropbear Bard"s ball(s).
|
|The banded bear
|without a care,
|Banged on himself for e'er and e'er
|
|Farewell, dear collar bear