If we heavily call the spawn_blocking, there might be no available thread to run the current core. Except the task in the lifo_slot, all tasks in cores can be stolen, so we move the task from the lifo_slot to the run_queue before calling the spawn_blocking in the block_in_place.
This can prevent the starvation of the task in lifo_slot in edge cases.
If we heavily call the
spawn_blocking
, there might be no available thread to run the current core. Except the task in the lifo_slot, all tasks in cores can be stolen, so we move the task from the lifo_slot to the run_queue before calling thespawn_blocking
in theblock_in_place
.This can prevent the starvation of the task in
lifo_slot
in edge cases.