[
https://issues.apache.org/jira/browse/ARROW-3660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670174#comment-16670174
]
Francois Saint-Jacques commented on ARROW-3660:
-----------------------------------------------
You should still be able to resize a read-only memory map. Use case: process-1
append-only writer, process-2 reader that needs to remap once in a while. I'd
change the following:
* Take a new optional flag (default=true) in the constructor that hints if the
memory map is expected to be resizable, e.g. `resizable`.
* Hide the lock/mutex condition in a private method, e.g. `GetResizeMutex()`
and in this function, switch on this new property instead of `writable()`.
Thus if you want the performance optimisation by avoiding the contended mutex,
you construct with `resizable=false`.
> [C++] Don't unnecessarily lock MemoryMappedFile for resizing in readonly files
> ------------------------------------------------------------------------------
>
> Key: ARROW-3660
> URL: https://issues.apache.org/jira/browse/ARROW-3660
> Project: Apache Arrow
> Issue Type: New Feature
> Components: C++
> Affects Versions: 0.11.0
> Reporter: Dimitri Vorona
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> We lock the resize_lock_ on every read, even though it's not possible to
> resize read-only files.
>
> This also inlines the ResizeMap method into Resize.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)