[issue2643] mmap_object_dealloc calls time-consuming msync(), although close doesn't

Antoine Pitrou report at bugs.python.org
Tue Sep 21 17:41:00 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

It's a pity that flush() is defined like this. Ideally, if mmap claims to mimick ordinary file objects, flush() should be a no-op() and there should be a separate sync() method.

On the other hand, your (Charles-François's) patch is already much better than the statu quo.
If nobody objects, I think it should be committed to 3.2. Whether or not we should be backport it to the stable branches is a bit more delicate, since it /could/ break badly written applications...

On a sidenote, the mmap object has received a *lot* less attention during the years than the other IO primitives (especially file objects in 3.x). It should probably only be used for specialized cases.

----------
components: +IO, Library (Lib)
stage: patch review -> commit review
title: mmap_object_dealloc does not call FlushViewOfFile on windows -> mmap_object_dealloc calls time-consuming msync(), although close doesn't
versions:  -Python 2.6, Python 2.7, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2643>
_______________________________________


More information about the Python-bugs-list mailing list