apache / apache/arrow

[C++] Add a ThreadLocalState concept built on thread local

Open
#31,581 3 comments 0 reactions 0 assignees View on GitHub
Component: C++ Type: task
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 18h
Merged PRs (30d)
91

Description

The ThreadLocalState is tied to an executor and, on creation, creates a state for every thread in the executor. In order to quickly access a particular thread's state we need a way to get a thread index (the index of the thread in the executor). Historically we used ThreadIndexer and this JIRA introduces a new approach using thread local.

Similar to the ThreadIndexer this thread local state concept will fail when the capacity is resized during a run.

Similar to the ThreadIndexer this concept won't work too well for serial execution until ARROW-15732 is resolved.

**Reporter**: [Weston Pace](https://issues.apache.org/jira/browse/ARROW-16178) / @westonpace
#### PRs and other links:
- [GitHub Pull Request #12871](https://github.com/apache/arrow/pull/12871)

**Note**: *This issue was originally created as [ARROW-16178](https://issues.apache.org/jira/browse/ARROW-16178). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Start by reviewing GitHub pull request #12871 and the existing ThreadIndexer approach described in the issue. Check the stated executor, capacity-resize, and serial-execution constraints, with ARROW-15732 as related context; the work is done when the ThreadLocalState concept provides per-thread executor state and thread-index access without violating those constraints.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.