Dynamic Circular Work-Stealing Deque (SPAA'05)
David Chase (Sun Microsystems Laboratories, Burlington, MA)
Yossi Lev (Brown University & Sun Microsystems Laboratories, Burlington, MA)
Description
This paper describes a simple lock-free work-stealing deque. A work-stealing deque allows a single thread to push and pop elements to/from one end of a queue, while other threads are allowed to steal elements from the other end of the queue. The authors present an improvement over a previous work-stealing deque by Arora, Blumofe, and Plaxton, which uses fixed array sizes. In the deque presented in this paper, the elements are stored in a cyclic array that can grow when it overflows. The algorithm has no limit other than integer overflow (and the system´s memory size) on the number of elements that may be on the deque, and the total memory required is linear in the number of elements in the deque. Work-stealing deques are important for dynamic load balancing, and used in systems like Cilk Plus and Intel Thread Building Blocks (although none of them actually use Chase-Lev deques). The ForkJoinPool in Java 7 however states that "The main work-stealing queue design is roughly similar to those in the papers Dynamic Circular Work-Stealing Deque by Chase and Lev, SPAA 2005 and Idempotent work stealing by Michael, Saraswat, and Vechev, PPoPP 2009. |
Questions
Question 1:
Which deque operations may execute concurrently?
Question 2:
In which situations do the deque issue the more expensive compare-and-swap instruction?
Magnus
Q1: Q2: |
Afshin
Q1: Q2:
|
Stavros
Q1: Q2:
CAS may is also used when trying to shrink the pool, to detect cases where the shrink operation was completed by another process. |
Pan
Q1: 'pushBottom' and 'popBottom' are only executed by the deque's owner. 'steal' can be executed concurrently. Q2: 'steal' does a CAS on the top index. This prevents two concurrent stealer threads from getting the same element. |
Pavol
Q1: Q2: |
Kjell
Q1: Q2: |
Fred
Q1: Q2: |
Jonatan
Q1: Q2: |
Sofia
Q1: Q2: |