Skip to content

Tags: yeqiaojun/kcp-go

Tags

v5.0.56

Toggle v5.0.56's commit message
Update .gitignore

v5.0.55

Toggle v5.0.55's commit message
Replace heap scheduler with fixed-tick shards

Rewrite TimedSched internals from a heap+timer design to a sharded fixed-tick scheduler: add timedSchedResolution, per-shard incoming queues, wake channels, and a runShard loop that scans tasks on a ticker and executes due work immediately. Preserve public API (NewTimedSched, Put, Close) but clamp parallelism to >=1 and add defaultTimedSchedParallel() based on GOMAXPROCS. Update Put to route tasks to shards and wake shards for already-due tasks; remove the prepend goroutine, per-worker heaps, and per-task timer reset logic. Also add scheduler regression tests and benchmarks (including TestTimedSchedZeroParallelStillRunsTasks and BenchmarkTimedSched5000Recurring/Burst) and a design plan doc under docs/plans. Fixes zero-parallel bug and improves scheduling scalability and determinism.

v1.0.1

Toggle v1.0.1's commit message
Replace heap scheduler with fixed-tick shards

Rewrite TimedSched internals from a heap+timer design to a sharded fixed-tick scheduler: add timedSchedResolution, per-shard incoming queues, wake channels, and a runShard loop that scans tasks on a ticker and executes due work immediately. Preserve public API (NewTimedSched, Put, Close) but clamp parallelism to >=1 and add defaultTimedSchedParallel() based on GOMAXPROCS. Update Put to route tasks to shards and wake shards for already-due tasks; remove the prepend goroutine, per-worker heaps, and per-task timer reset logic. Also add scheduler regression tests and benchmarks (including TestTimedSchedZeroParallelStillRunsTasks and BenchmarkTimedSched5000Recurring/Burst) and a design plan doc under docs/plans. Fixes zero-parallel bug and improves scheduling scalability and determinism.