apache / apache/arrow

[C++] Create work stealing implementation of generalized ThreadPool

Open
#28,631 1 comment 0 reactions 0 assignees View on GitHub
Component: C++ Type: task
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

Given the chase-lev deque and the generalized thread pool we are now able to create a work stealing version.  This issue forces us to address some thorny issues that don't concern academic thread pools.

For example, we need to allow tasks for the thread pool to be submitted from outside the thread pool itself.  An academic work-stealing thread queue has one queue per thread and each thread adds incoming tasks to its own queue.  If the task adding queue isn't in the thread pool then it doesn't have a queue.  This is a tricky issue because it implies a queue with multiple producers and multiple consumers.

There's a couple of ways to tackle this but generally it means that the work stealing thread pool is going to have to rely on locking in a number of places.  Ideally the hot path can be kept lock free.

**Reporter**: [Weston Pace](https://issues.apache.org/jira/browse/ARROW-12902) / @westonpace

**Note**: *This issue was originally created as [ARROW-12902](https://issues.apache.org/jira/browse/ARROW-12902). 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 locating and reading the existing chase-lev deque and generalized thread pool implementations mentioned in the issue. Define the work-stealing design around externally submitted tasks and multiple producers and consumers, then verify that the implementation works while keeping the hot path as lock-free as practical.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.