You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Weston Pace (Jira)" <ji...@apache.org> on 2021/01/20 17:36:00 UTC

[jira] [Commented] (ARROW-8732) [C++] Let Futures support cancellation

    [ https://issues.apache.org/jira/browse/ARROW-8732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17268725#comment-17268725 ] 

Weston Pace commented on ARROW-8732:
------------------------------------

In C# they have cancellation tokens separate from futures (tasks in C#).  The logic is that cancellation tokens could be used in a wide variety of situations.  Perhaps coroutines, perhaps synchronous blocking code, perhaps async/await where the Tasks are somewhat hidden.  By creating a separate cancellation token they can maintain a consistent capability regardless of what threading utilities are in use.

From an Arrow perspective, even if we are only using futures, we might not want to expose the futures API to the customer.  I think we probably will want to (it's would be beneficial to customers also writing asynchronous code) but cancellation tokens would allow us to choose not to.

Also, a lesser concern, but the user can create one cancellation token and use it across several arrow calls.  So if some end-user action triggers a number of Arrow operations, some in parallel and some in series, the application doesn't have to keep track of all those futures.

 

> [C++] Let Futures support cancellation
> --------------------------------------
>
>                 Key: ARROW-8732
>                 URL: https://issues.apache.org/jira/browse/ARROW-8732
>             Project: Apache Arrow
>          Issue Type: Wish
>          Components: C++
>            Reporter: Antoine Pitrou
>            Assignee: Antoine Pitrou
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 4h 50m
>  Remaining Estimate: 0h
>
> There should be a way for consumers of Futures to notify that they are not interested in the task at hand anymore. For some kinds of tasks this may allow cancelling the task in-flight (e.g. an IO task, or a task consisting of multiple steps).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)