libxtc 0.4.0
Async concurrency for C: Tokio + Seastar + BEAM, in one library
Loading...
Searching...
No Matches
sched_int.h
1/* Internal lane policy state. No queue links or allocation. */
2#ifndef XTC_SCHED_INT_H
3#define XTC_SCHED_INT_H
4#include "xtc_sched.h"
5#include <stdatomic.h>
6#ifdef XTC_ENABLE_SCHED_POLICY
7struct xtc_sched_state {
8 /* 0: setup, 1: descriptor being copied, 2: permanently frozen. */
9 _Atomic int phase;
10 xtc_sched_policy_t policy;
12 uint64_t bypasses[17], runs[17];
13 uint32_t batch_ready[16], batch_active[16];
14 unsigned char batch_attached[16];
15 unsigned batch_next;
16};
17/* Caller serializes pre-run/owner access and brackets unsafe bookkeeping.
18 * One group per explicit class; default-lane groups do not register. */
19int __xtc_sched_batch_attach(xtc_loop_t *, int);
20void __xtc_sched_batch_detach(xtc_loop_t *, int);
21void __xtc_sched_batch_hint(xtc_loop_t *, int, uint32_t, uint32_t);
22void __xtc_sched_freeze(xtc_loop_t *);
23int __xtc_sched_select(xtc_loop_t *);
24void __xtc_sched_service(xtc_loop_t *, int);
25void __xtc_sched_ran(xtc_loop_t *, int, int);
26#endif
27#endif