Questions tagged [work-stealing]

A task scheduling algorithm, well suited for shared memory environments, where parallel processors can easily access each other's pending tasks.

Work staling is an algorithm / policy for distributing work in parallel computation. It particularly fits with modern shared memory multi-core machines. It was first described in http://supertech.csail.mit.edu/papers/steal.pdf‎ and the most common implementation is in the Cilk/CilkPlus programming language (http://en.wikipedia.org/wiki/Cilk).

31 questions
34
votes
10 answers

Implementation of a work stealing queue in C/C++?

I'm looking for a proper implementation of a work stealing queue in C/CPP. I've looked around Google but haven't found anything useful. Perhaps someone is familiar with a good open-source implementation? (I prefer not to implement the pseudo-code…
unknown
27
votes
1 answer

Java ForkJoinPool with non-recursive tasks, does work-stealing work?

I want to submit Runnable tasks into ForkJoinPool via a method: forkJoinPool.submit(Runnable task) Note, I use JDK 7. Under the hood, they are transformed into ForkJoinTask objects. I know that ForkJoinPool is efficient when a task is split into…
Ivan Voroshilin
  • 4,493
  • 3
  • 29
  • 56
11
votes
1 answer

When to use the disruptor pattern and when local storage with work stealing?

Is the following correct? The disruptor pattern has better parallel performance and scalability if each entry has to be processed in multiple ways (io operations or annotations), since that can be parallelized using multiple consumers without…
10
votes
2 answers

Is Work Stealing always the most appropriate user-level thread scheduling algorithm?

I've been investigating different scheduling algorithms for a thread pool I am implementing. Due to the nature of the problem I am solving I can assume that the tasks being run in parallel are independent and do not spawn any new tasks. The tasks…
Il-Bhima
  • 10,298
  • 1
  • 42
  • 50
8
votes
3 answers

Work/Task Stealing ThreadPoolExecutor

In my project I am building a Java execution framework that receives work requests from a client. The work (varying size) is broken down in to a set of tasks and then queued up for processing. There are separate queues to process each type of task…
Anand Nadar
  • 236
  • 3
  • 14
5
votes
2 answers

In Java 8, does Executors.newWorkStealingPool() also provide a task queue?

Is there a queue of pending tasks used in conjunction with Java 8's Executors.newWorkStealingPool()? For example, suppose the # available cores is 2, and Executors.newWorkStealingPool() is empty because 2 tasks are already running. Then what…
4
votes
2 answers

Use CompletableFuture on ForkJoinpool and avoid thread waiting

Hello I thought with CompletableFuture and the default ForkJoinPool I could optimize execution of task more than a classic ExecutorService but I missing something With this code the execution takes 1 seconds, I have 3 worker threads: for (int i = 0;…
4
votes
3 answers

Work stealing and deques

Why do we need a deque for work-stealing? (e.g. in Cilk) The owner works on the top and the thief steals from the bottom. Why is it useful? We might have multiple thieves stealing from the bottom. So, don't we need a lock anyway? I have read…
3
votes
1 answer

Atomic storage in Chase-lev deque

I am implementing the Chase-lev deque based on the paper: "Correct and Efficient Work-Stealing for Weak Memory Models". In the paper, it requires the deque to have a buffer with atomic elements: struct Deque { std::atomic size; …
Tes
  • 299
  • 2
  • 9
2
votes
0 answers

Understanding the work stealing algorithm

I have read a lot on this algorithem. When explaining this algorithem , the words : work stealing algorithm [closed] Those forked subtasks can recursively create more subtasks themself and thus fill up the working queues of the parallely…
Ida Amit
  • 1,077
  • 1
  • 8
  • 20
2
votes
1 answer

Work Stealing: join a recursive task requires stealing?

I'm trying to understand the effect of work stealing on recursive tasks: One of the advantages of work stealing is that the current worker/thread is likely to execute its own spawned tasks; increasing data locality. However, what happens in the…
Marco Servetto
  • 590
  • 4
  • 12
2
votes
1 answer

Work-stealing parallel job doesn't seem to steal much work

The idea is to run a parallel job on a 96-cores machine, with a work stealing ForkJoinPool. Below is the code I'm using so far: import scala.collection.parallel.ForkJoinTaskSupport import scala.concurrent.forkjoin.ForkJoinPool val sequence:…
Jivan
  • 16,401
  • 7
  • 56
  • 89
2
votes
1 answer

How can I show that in Java Fork/Join framework work-stealing occurs?

I would like to improve my fork/join little example to show that during Java Fork/Join framework execution work stealing occurs. What changes I need to do to following code? Purpose of example: just do a linear research of a value breaking up work…
giampaolo
  • 6,648
  • 5
  • 42
  • 73
1
vote
4 answers

work stealing algorithm

I am reading an article about Concurrency Runtime, and there is algorithm named work stealing in this article. but I have no idea what this algorithm is! so I want a little explanation or some good link that could help me to make a presentation…
Lrrr
  • 4,390
  • 5
  • 39
  • 61
1
vote
0 answers

Boost.Fibers hosted by worker threads seem not to work – why?

I'd like to use Boost.Fibers hosted by worker threads instead of just threads. I think I've done everything as in the manual while writing the code shown below, but it seems not to work – " called" is missing in the output. Does anyone…
A. Klimov
  • 73
  • 4
1
2 3