theseus-os / Theseus

Theseus is a modern OS written from scratch in Rust that explores 𝐢𝐧𝐭𝐫𝐚𝐥𝐢𝐧𝐠𝐮𝐚𝐥 𝐝𝐞𝐬𝐢𝐠𝐧: closing the semantic gap between compiler and hardware by maximally leveraging the power of language safety and affine types. Theseus aims to shift OS responsibilities like resource management into the compiler.
https://www.theseus-os.com/
MIT License
2.92k stars 172 forks source link

Lazily remove exited tasks from run queue #1095

Open tsoutsman opened 10 months ago

tsoutsman commented 10 months ago

Avoids locking all the schedulers on task exit.

This PR also technically changes the round robin scheduler algorithm, as blocked tasks are now moved to the end of the run queue. Previously, the blocked tasks would be kept in place, aside from the task at the front of the queue which would be switched with the next runnable task using swap_remove_front.