[New-bugs-announce] [issue18816] "mmap.flush()" is always synchronous, hurting performance

Jesús Cea Avión report at bugs.python.org
Fri Aug 23 06:55:08 CEST 2013

New submission from Jesús Cea Avión:

Currently, "mmap.flush()" does a synchronous write to the backend file. The call will wait until data is actually flushed to disk, because internally it is doing a "msync(MS_SYNC)".

But the value of "mmap.flush()" is to synchronize file and memory. You don't need a synchronous write in the general case.

I propose to add an optional keyword parameter with default value "SYNC" (compatibility) but that can be "ASYNC", "INVALIDATE" (can be "SYNC|INVALIDATE" and "ASYNC|INVALIDATE" too).

I am talking about UNIX MMAP. No idea about Windows.

Check "man msync" for useful cases.

components: Extension Modules
keywords: easy
messages: 195941
nosy: jcea
priority: normal
severity: normal
status: open
title: "mmap.flush()" is always synchronous, hurting performance
type: enhancement
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list