waker_protocol 0.2.1
“Custom waker protocol on top of waker_tables: a task scheduler with QoS policy, checkpoints, typed envelopes and capitulation (a task surre…”
Basename is uppercase README.mdCaret or XOR expression text
SHA-256b4c703101d1631040766d9c352ca16d4851d45735356ac039deb796da1052565
MaleculeH(Db)Md
Evidence
1use waker_protocol::{
2 derive_protocol_task_vtable, MemoryCheckpointStore, ProtocolTask, QoSClass, TaskPolicy,
3 TaskPoll, WakeReason, WakerProtocol,
4};
5use waker_tables::VTableKey;
6use std::time::{Instant};
7use std::collections::HashMap;
8
9// --- 1. The Stateful Chaos Task ---
10struct ChaosTask {
11 id: u32,
12 state: Vec<u64>,
13 wake_counts: H …
14:8… cancelled: bool,
15}
16
17// unsafe impl ProtocolTask for ChaosTask {
18// unsafe fn poll(&mut self) -> TaskPoll {
19// // Simulate a task that "works" by allocating and then potentially finishing
20// if self.is_cancelled {
21// return TaskPoll::Re …
39:11… Push 1KB of data EVERY poll cycle.
40 // With 1000 tasks and 500 steps, that's potentially 500MB.
41 let extra = vec![self.id as u8; 1024];
42 for val in extra {
⋯4 lines
90:42… oSClass::Interactive } else { QoSClass::Background };
91
92
93 for i in 0..1000 {
94 let mut policy = TaskPolicy::default();
95 // FORCE RECLAMATION: Tell the scheduler this task should only use 1KB.
96 // When it hits 5KB in the poll, the scheduler MUST react.
97 …
3:84… bles).
4
5Tasks live in a generation-checked slab and are driven by a scheduler that
6understands quality of service, retention, checkpoints and capitulation.
7Capitulation is the idea the crate is built around: a task surrenders with a
8stated reason, after a checkpoint, so the work can go somewhere else. The
9scheduler keeps a reclaim log of every such event.
10
11## Pieces
12
13| module | what it holds |
14|---|---|
15| `scheduler` | `WakerProtocol`, `SchedulerHandle`, `TaskHandle`, the resident task table …
No evidence locations were recorded for this file. Raw result