[Python-Dev] wait time [was: Ext4 data loss]

R. David Murray rdmurray at bitdance.com
Thu Mar 12 21:16:32 CET 2009


On Thu, 12 Mar 2009 at 20:56, "Martin v. Löwis" wrote:
>> It is starting to look as though flush (and close?) should take an
>> optional wait parameter, to indicate how much re-assurance you're
>> willing to wait for.
>
> Unfortunately, such a thing would be unimplementable on most of today's
> operating systems.

I read Jim's suggestion as a way to indicate the strength of the desire
of the application programmer for certainty, not as a time value.
In other words, 0.0 would map to 'just flush it', 0.5 might map to
'fsync', and 1.0 map to OS-X's "tell the disk to flush its buffers' call.

Assuming I'm right, I don't like the proposal.  It feels too squishy:
the semantics are not well defined.

By the way, I would not like to see python programmers encouraged to make
the same mistake that sqlite3 made.  The decision about how aggressive
to be on flushing data to disk should be in the hands of the _user_, not
the application.  Of course, the application needs some way to enable
the user to make that decision, which is what I presume we are talking
about supporting here.

--
R. David Murray           http://www.bitdance.com


More information about the Python-Dev mailing list