linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to stay acid-compliant when using mmap'ed files
@ 2007-10-09 15:54 Dennis Heuer
  2007-10-09 22:50 ` Glynn Clements
  0 siblings, 1 reply; 2+ messages in thread
From: Dennis Heuer @ 2007-10-09 15:54 UTC (permalink / raw)
  To: linux-c-programming

hello,

i don't really understand the implications of using mmap. for example,
will linux write out changes to an mmap'ed file as is or as part of a
full page-write? if the latter is true, what happens if the program
reads from mmap'ed pages but writes directly to the file? as far as i
see it, linux will catch the writing and divert it to the mmap'ed page.
this implies that only full page-writes will reach the file.

i ask about this because if i want to write a transaction-safe layer
for a database in a file and linux always affects more bytes in the
file than the program actually commanded, there's no way, after a crash,
to know about what area was actually affected and possibly crippled up.

am i right or is there something i miss? how is it with common file
accesses (via write or fwrite). are they paged automatically by the os
too?

regards,
dennis heuer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-09 22:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-09 15:54 how to stay acid-compliant when using mmap'ed files Dennis Heuer
2007-10-09 22:50 ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).