Core component
Flyology Runtime
An experimental GNAT runtime extension for ordinary Ada tasking. Native tasks keep their OS threads, while explicitly designated lightweight tasks run cooperatively on shared event loops.
task Connection is
pragma Task_Info
(Flyology.Lightweight_Task);
end Connection;
Flyology.IO.Sockets.Receive
(Socket, Buffer, Last, Timeout => 1.0);
task Connection is
pragma Task_Info
(Flyology.Native_Task);
end Connection;
Flyology.IO.Sockets.Receive
(Socket, Buffer, Last, Timeout => 1.0);
Programming model
Two lanes share one tasking language.
The designation changes where a task executes. It does not introduce an async dialect or replace Ada task semantics.
Shared event-loop thread
Dedicated OS thread
Runtime architecture
Each mechanism has one responsibility.
The poller reports readiness. The scheduler selects a runnable fiber. The context switch preserves its stack. GNARL continues to define Ada task behavior.
Read the architecture guide- 01
Event polling
The runtime uses
kqueueon Darwin to wait for readiness and completion. On Linux, it usesepollfor readiness andeventfdfor cross-thread wakes. - 02
Cooperative scheduling
Per-group priority queues and deadline heaps select ready work. CPU-bound lightweight tasks must reach a cooperative safe point.
- 03
Stackful contexts
Guarded stacks and a small register swap preserve locals, exception state, task identity, and synchronous control flow.
- 04
Ada task semantics
Rendezvous, protected objects, activation, masters, abort, and task identity retain their ordinary meanings.
Included building blocks
Synchronous APIs keep operational boundaries explicit.
The runtime crate includes task-aware I/O and bounded systems primitives. Capacity, ownership, recovery, cancellation, and blocking remain explicit.
- Task-aware I/O
- Sockets, files, timers, DNS, TLS, file watching, and subprocess pipes.
- Execution control
- Shared and dedicated groups, migration, pool sizing, and thread pins.
- Bounded coordination
- Ownership-transfer buffers, channels, and structured task supervision.
- Shared storage
- Mappings, descriptor handoff, arenas, rings, maps, vectors, and slab pools.
Runtime boundaries
Constraints are part of the interface.
Flyology Runtime does not claim hard real-time behavior, preemptive lightweight scheduling, production qualification, or universal compiler portability.
Review current constraints| Concern | Contract |
|---|---|
| Compatibility | With the native project default, undesignated tasks remain native. Event machinery starts lazily. |
| Fairness | Scheduling within a group is cooperative, with explicit safe points. |
| Foreign calls | Blocking foreign work belongs on a native task or an explicit native boundary. |
| Compiler support | Runtime preparation accepts only exact verified compiler patch families. |