Thursday, 15 August 2013

In Linux, when a process is about to be swapped or terminated, what state should its threads be in?

In Linux, when a process is about to be swapped or terminated, what state
should its threads be in?

By swapped and terminated, I mean, if the process is about to be swapped
to a swap space or terminated(by OOM killer) to free up memory.
What algorithm does the linux kernel follow?
For instance, Process A needs extra memory and Process B has been chosen
to be swapped or killed(if swap space is already occupied), but process B
still has a blocking thread.
a.) Does process B gets swapped or killed regardless of the blocking thread?
b.) If not, how is this kind of case handled?
If my example is an unlikely case, any insights would be appreciated.

No comments:

Post a Comment