Module worker

Module worker 

Source

StructsΒ§

GCWorker
A GC worker. This part is privately owned by a worker thread.
GCWorkerShared
The struct has one instance per worker, but is shared between workers via the scheduler instance. This structure is used for communication between workers, e.g. adding designated work packets, stealing work packets from other workers, and collecting per-worker statistics.
WorkerGroup πŸ”’
A worker group to manage all the GC workers.
WorkerShouldExit πŸ”’
A special error type that indicate a worker should exit. This may happen if the VM needs to fork and asks workers to exit.

EnumsΒ§

WorkerCreationState πŸ”’
Stateful part of WorkerGroup.

ConstantsΒ§

STAT_BORROWED_MSG πŸ”’
WORKER_ORDINAL πŸ”’
Current worker’s ordinal

FunctionsΒ§

current_worker_ordinal
Get current worker ordinal. Return None if the current thread is not a worker.

Type AliasesΒ§

PollResult πŸ”’
The result type of GCWorker::pool. Too many functions return Option<Box<dyn GCWork<VM>>>. In most cases, when None is returned, the caller should try getting work packets from another place. To avoid confusion, we use Err(WorkerShouldExit) to clearly indicate that the worker should exit immediately.
ThreadId
Represents the ID of a GC worker thread.