Skip to content

readyFiberCount

ffredyk edited this page Jul 23, 2026 · 1 revision

readyFiberCount

Category

Scheduler Management

Arity

UnaryreadyFiberCount <schedulerId>.

readyFiberCount <number>

Description

Returns the number of ready fibers on the given scheduler — fibers that are not sleeping or awaiting and are eligible to run on the next scheduler tick. High ready count means the scheduler has work queued up.

How It Works

Counts fibers in the scheduler's ready queue only — excludes fibers in the waiting list (sleep/await).

Usage

_ready = readyFiberCount 1;    // e.g., 5
systemChat f"Ready fibers: {_ready}";

Detect backlog

_ready = readyFiberCount _schedulerId;
if (_ready > 50) then {
    systemChat f"Scheduler {_schedulerId} backlogged: {_ready} fibers waiting";
};

With fiberCount

_total = fiberCount 1;
_ready = readyFiberCount 1;
_pctReady = if (_total > 0) then { _ready / _total * 100 } else { 0 };
systemChat f"{_pctReady}% fibers ready to run";

Thread Safety

ReadOnly — approximate snapshot. Safe from any scheduler.

See Also

SQ# Wiki

Home

Engine Docs

Migration

Commands

Value Constructors

Arithmetic

Comparison

Logic

Array

String

Math

Random

Type & Introspection

HashMap

Code Execution

Concurrency

Scheduler

Thread Safety

Error

Output

Time

Multiplayer

Compiler

Clone this wiki locally