DiversionQueue

data class DiversionQueue(    val interpreterSurplus: Int,     val postponedSafeTasks: ImmutableList<AvailTask>?,     val postponedInterpreterTasks: ImmutableList<AvailTask>?)

An immutable state object that can atomically replace the current state in activeDiversionQueue via a compare-and-set (with retries).

Constructors

Link copied to clipboard
fun DiversionQueue(    interpreterSurplus: Int,     postponedSafeTasks: ImmutableList<AvailTask>?,     postponedInterpreterTasks: ImmutableList<AvailTask>?)

Properties

Link copied to clipboard
val interpreterSurplus: Int

If zero, no tasks are running. If positive, that many interpreter tasks have been sent to the executor and have not yet completed. If negative, the magnitude says how many safe point tasks have been sent to the executor and have not yet completed.

Link copied to clipboard
val postponedInterpreterTasks: ImmutableList<AvailTask>?

The queue of interpreter tasks that should run when we're next able to run interpreter tasks. Null indicates an empty queue. Safe-point tasks have precedence, so if there are any outstanding safe point tasks, or if any are queued, then queue new interpreter tasks here instead of allowing them to execute.

Link copied to clipboard
val postponedSafeTasks: ImmutableList<AvailTask>?

The queue of safe-point tasks that should run when we're next at a safe point. Null indicates an empty queue. Safe-point tasks have priority over interpreter tasks, so new interpreter tasks should not be started if there are any safe-point tasks queued here, or if the interpreterSurplus is negative, indicating it's processing safe-point tasks already.

Link copied to clipboard
val safePointRequested: Boolean