MegaByte & Linux
Linux Linux
Hey MegaByte, I’ve been looking into a new lightweight concurrency model for the kernel’s module system and thought you might have some insights or fresh ideas—got any thoughts on how to keep the scheduler deterministic while still keeping the code clean?
MegaByte MegaByte
Sure thing. The trick is to give each thread a fixed priority band and let the scheduler run only one per band at a time. That way you get determinism—no race on the priority queue. Keep the scheduler logic in a single small module, expose a clear API for the kernel modules, and use lock-free queues for the work items. Then just rely on atomic ops for the counters. It stays clean, and you avoid the usual contention headaches.