WorkStealingQueue

class WorkStealingQueue<E : Comparable<E>>(parallelism: Int) : AbstractQueue<E> , BlockingQueue<E>

A WorkStealingQueue tracks parallelism separate subqueues of tasks. Each Interpreter feeds and consumes a distinct subqueue dedicated to that interpreter thread, ideally without contention from other threads. When a subqueue is exhausted, the requesting thread will examine the other threads' queues and steal one for itself. Only at that point will contention occur.

Each subqueue is maintained in priority order, but the aggregate collection of queues cannot be considered strictly ordered.

Constructors

Link copied to clipboard
fun WorkStealingQueue(parallelism: Int)

Functions

Link copied to clipboard
abstract override fun add(element: E): Boolean
Link copied to clipboard
abstract fun addAll(elements: Collection<E>): Boolean
Link copied to clipboard
abstract fun clear()
Link copied to clipboard
abstract operator override fun contains(element: E): Boolean
Link copied to clipboard
abstract fun containsAll(elements: Collection<E>): Boolean
Link copied to clipboard
open override fun drainTo(c: MutableCollection<in E>): Int
open override fun drainTo(c: MutableCollection<in E>, maxElements: Int): Int
Link copied to clipboard
abstract fun element(): E
Link copied to clipboard
open fun forEach(p0: Consumer<in E>)
Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): MutableIterator<E>
Link copied to clipboard
open override fun offer(element: E): Boolean
open override fun offer(    e: E,     timeout: Long,     unit: TimeUnit): Boolean
Link copied to clipboard
open fun parallelStream(): Stream<E>
Link copied to clipboard
open override fun peek(): E?
Link copied to clipboard
open override fun poll(): E?
open override fun poll(timeout: Long, unit: TimeUnit): E?
Link copied to clipboard
open override fun put(e: E)
Link copied to clipboard
open override fun remainingCapacity(): Int
Link copied to clipboard
abstract fun remove(): E
open override fun remove(element: E): Boolean
Link copied to clipboard
abstract fun removeAll(elements: Collection<E>): Boolean
Link copied to clipboard
open fun removeIf(p0: Predicate<in E>): Boolean
Link copied to clipboard
abstract fun retainAll(elements: Collection<E>): Boolean
Link copied to clipboard
open override fun spliterator(): Spliterator<E>
Link copied to clipboard
open fun stream(): Stream<E>
Link copied to clipboard
open override fun take(): E
Link copied to clipboard
open fun toArray(): Array<Any>
open fun <T : Any> toArray(p0: Array<T>): Array<T>
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>

Properties

Link copied to clipboard
open override val size: Int