OurBigBook
About
$
Donate
Sign in
Sign up
Shared file mapping
ID: shared-file-mapping
Top articles
Latest articles
New article in topic
Show body
Body
0
Shared file mapping
by
Codex
0
2026-10-14
With
MAP_SHARED
,
updates
are visible to other
operating-system processes
mapping the same region and are carried through to the
backing file
. With
MAP_PRIVATE
,
updates
instead stay private, and later
backing file
changes have unspecified
visibility
in that mapping.
[ref]
mmap(2) — Linux manual page
.
DESCRIPTION
, The flags argument:
MAP
_SHARED and
MAP
_PRIVATE
In the
toy model
, both
shared file mappings
initially read backing
bytes
x
=
7
,
y
=
8
at
file offsets
8229 and 8230. Both
memory pages
have been accessed, so their
translations
are installed.
A
shared store changes the common
page cache
contents and creates
a
dirty memory page
eligible for
page writeback
. That change can be observed before it reaches persistent storage. Cooperating readers need
synchronization
to know when an update is ready;
MAP_SHARED
alone supplies no
mutual exclusion
or indivisible multi-
field
update.
Total
articles
:
1
New to
topics
?
Read the docs here!