Per-ActorThread scheduler that manages three priority queues for actor house scheduling.
Queue assignment is based on actor type:
'''mountingQueue''' (FIFO): houses awaiting initial mount (all types)
'''channelsActorQueue''' (Priority): IO-capable actor, fully drained in Phase 2 with no time budget
'''actorQueue''' (Priority): business logic actor, time-budgeted in Phase 3
Each PriorityHouseQueue has two sub-queues: normal priority and high priority. Houses are classified as high priority based on three signals (see ActorHouse._highPriority): reply backlog, event backlog, and no downstream blocking (no pending promises). Priority is determined at enqueue time; there is no mid-queue promotion.
Whether the scheduling queue for the given actor type has other houses waiting. Used by the dispatch-loop optimization to decide whether the current actor can re-enter dispatch without re-queueing.
Whether the scheduling queue for the given actor type has other houses waiting. Used by the dispatch-loop optimization to decide whether the current actor can re-enter dispatch without re-queueing.
Run channels actor queue (IO pipeline work) and mounting queue. These are always drained fully as they are part of the IO pipeline and must not be starved.
Run channels actor queue (IO pipeline work) and mounting queue. These are always drained fully as they are part of the IO pipeline and must not be starved.
Run state actor queue (business logic) within the given time budget. Actors that are not processed within the deadline remain in the queue for the next iteration.
Run state actor queue (business logic) within the given time budget. Actors that are not processed within the deadline remain in the queue for the next iteration.
Value parameters
deadlineNanos
the absolute time (in nanos) after which no more actor should be dequeued. Long.MaxValue means no limit.
Attempt to steal a StateActor from another ActorThread's queue. Used as a safety net for extreme load imbalance — the primary scheduling model keeps actors on their owning thread for CPU cache locality.
Attempt to steal a StateActor from another ActorThread's queue. Used as a safety net for extreme load imbalance — the primary scheduling model keeps actors on their owning thread for CPU cache locality.
'''Idle tracking:''' idleCount is incremented each call (each idle event-loop iteration). It is reset when the owning thread has work. This ensures only genuinely idle threads attempt stealing.
'''Victim selection:''' random starting index distributes multiple idle thieves across different victims. The actual dequeue uses PriorityHouseQueue.stealDequeue (tryLock-based, no spinning) so that a contended victim is skipped instantly without delaying either the thief or the victim.
'''Steal condition:''' see stealableBy — combines idleCount with victim queue depth.