The module sat under peer/, beside connection logic. What it knows is a fact about the platform and the runtime: a tokio timer on Windows has the precision of the system tick. That fact belongs to the Native crate beside windows_job, with one owner, and callers state an instant without assuming how fine a timer is. It moves to the crate's top level and its header says so. wait takes exclusive access, so a second waiter on one deadline does not compile, where before it was only a convention. The thread's cost is now measured: sleeping in one-millisecond slices for ten seconds on this machine takes about 570 wake-ups a second and 0.16% of one core. All 206 Native tests pass.
65cac36d30
·
2026-11-26 07:02:49 +08:00
History