Foreground-background

Foreground-background is a scheduling algorithm that is used to control an execution of multiple processes on a single processor.

It is based on two waiting lists, the first one is called foreground because this is the one in which all processes initially enter, and the second one is called background because all processes, after using all of their execution time in foreground, are moved to background.

The time of execution is increased because the process needs more than 2 quanta to finish (this is the reason it was moved to background).

This gives the process the opportunity to finish within this newly designated time.

If the process does not finish after this, it is then preempted and moved to the end of the background list.