What happens to suspended jobs in unix

background-processjobsprocessprocess-managementsignals

We can issue CTRL+Z to suspend any jobs in Unix and then later on bring them back to life using fg or bg. I want to understand what happens to those jobs that are suspended like this ? Are they killed/terminated ? In other words what is the difference between killing and suspending a process ?

Best Answer

The jobs are not killed, they are suspended. They remain exactly as they are at the time of the suspension: same memory mapping, same open file, same threads, … It's just that the process sits there doing nothing until it's resumed. It's like when you pause a movie. A suspended process behaves exactly like a process that the scheduler stubbornly refuses to give CPU time to, except that the process state is recorded as suspended rather than running.

Related Question