DEV Community

Discussion on: A brief history of the Linux Kernel's process scheduler: The very first scheduler, v0.01

Collapse
 
seanballais profile image
Sean Francis N. Ballais • Edited

Why is t4's time slice 21 when woken up after resetting the other tasks? Shouldn't it be around 19.5?

Collapse
 
satorutakeuchi profile image
Satoru Takeuchi

It's 21 since t4's time slice is fill up with 15 and the current time slice divide by 2, in short, 12 / 2 = 6, is added to this value. So it becomes 15 + 6 = 21.

BTW, I fixed some wrong descriptions about the time slice bonus given to sleeping tasks. Thank you for letting me know.