humans run out of thinking resources.
A distraction interruption of what you’re doing physically or thinking Can cause you to stop and attend to the interruption.
this is scheduling in computers – CPU time or networks. Queuing.
people can have trouble going back to what they were doing if too much time passes or effort spent attending to the new task.
computers on the other hand have sophisticated ways to freeze a task and return to it later.
HOWEVER, there are conditions that are a bit similar to the forgetting from the interruption and the following human cognitive switching:
deadlock and starvation