[go: up one dir, main page]

|
|
Log in / Subscribe / Register

A way to do atomic writes

A way to do atomic writes

Posted Jun 2, 2019 16:55 UTC (Sun) by daniel (guest, #3181)
In reply to: A way to do atomic writes by perennialmind
Parent article: A way to do atomic writes

So in other words, you want exactly Tux3 semantics.


to post comments

A way to do atomic writes

Posted Jun 6, 2019 14:29 UTC (Thu) by Wol (subscriber, #4433) [Link]

A synchronous flush?

Dunno how easy it would be to implement this, but imagine ...

My application (database, whatever) writes a load of stuff - a user-space journal. It then calls the flush. This triggers writing all the buffers to disk, with a guarantee that writes AFTER my sync call can be moved EARLIER in time, but ALL EARLIER writes will complete before my call returns.

That way, my application knows, when the call returns, that it's safe to start updating the files because it can recover a crash from the logs. It doesn't interfere with other applications because it's not hogging i/o. And if it's one of the few applications on an almost-single-use system then the almost continuous flushing it might trigger probably won't actually get noticed much - especially if it's a multi-threaded database because it can happily mix flushing one transaction's logs with another transaction's data.

Cheers,
Wol


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds