You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Benjamin Kietzman (Jira)" <ji...@apache.org> on 2019/09/17 14:06:00 UTC
[jira] [Commented] (ARROW-2490) [C++] input stream locking
inconsistent
[ https://issues.apache.org/jira/browse/ARROW-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16931494#comment-16931494 ]
Benjamin Kietzman commented on ARROW-2490:
------------------------------------------
[~pitrou] should a similar concurrency checker be added to output streams?
> [C++] input stream locking inconsistent
> ---------------------------------------
>
> Key: ARROW-2490
> URL: https://issues.apache.org/jira/browse/ARROW-2490
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Affects Versions: 0.9.0
> Reporter: Antoine Pitrou
> Assignee: Antoine Pitrou
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.15.0
>
> Time Spent: 6h 20m
> Remaining Estimate: 0h
>
> Reading from the current file pointer is inherently thread-unsafe, since the file pointer may be updated by another thread (either before or during the operation). However, currently, we have:
> * {{ReadableFile::Read}} takes a lock
> * {{MemoryMappedFile::Read}} doesn't take a lock
> * {{BufferReader::Read}} doesn't take a lock
> We could always take a lock in {{Read}}. But I don't think there's a pattern where it's useful to call {{Read}} from multiple threads at once (since you're not sure where the file pointer will be exactly when the read starts). So we could as well specify that {{Read}} isn't thread-safe and let people make sure they don't call it from multiple threads.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)