SynchronizationLoops

Internal marker struct containing nested struct types used as identifiers for Unity's PlayerLoopSystem injection. Each nested struct represents a custom update loop that ParagonSynchronizationContext injects into Unity's player loop to trigger WorkRunner execution at specific frame phases.

Definition

Namespace: Paragon.Core.Async Assembly: Paragon.dll

[StructLayout(LayoutKind.Sequential, Size = 1)]
internal struct SynchronizationLoops

Visibility: internal — not accessible by game code.

Remarks

Unity's PlayerLoopSystem uses System.Type to identify custom loops. These empty structs serve purely as type markers — they carry no data (forced to Size = 1 by StructLayout). The ParagonSynchronizationContext creates PlayerLoopSystem entries with these types and registers them via PlayerLoopInjector.Inject().

Loop Registration

Nested Struct
Injected Into
Phase
Purpose

SynchronizationContextUpdate

PreUpdate (Append)

Update

Drains updateRunner queue each frame

SynchronizationContextLateUpdate

PreLateUpdate (Append)

LateUpdate

Drains lateUpdateRunner queue each frame

SynchronizationContextFixedUpdate

FixedUpdate (Prepend)

FixedUpdate

Drains fixedUpdateRunner each physics step

Nested Types

SynchronizationContextUpdate

Marker type for the Update-phase synchronization loop.

SynchronizationContextLateUpdate

Marker type for the LateUpdate-phase synchronization loop.

SynchronizationContextFixedUpdate

Marker type for the FixedUpdate-phase synchronization loop.

See Also

Last updated