0
If a process is suspended (swapped to secondary memory), then does the process control block also get swapped to secondary memory? Or would the process control block remain in main memory, whilst the rest of the process is swapped out to secondary memory.
It seems to me that the process control block would have to remain in main memory; otherwise, in the future, how would the OS remember that there is a suspended process in secondary memory?
I would greatly appreciate it if anyone could please take the time to clarify these concepts.
Suspension and being swapped out are not the same, but are two distinct conditions. A process can be suspended and still be memory resident. – sawdust – 2017-01-25T06:00:44.563
@sawdust Really? My textbook discusses them as being synonymous. I would appreciate it if someone could please confirm this. Also, do you have any information on the process control block concept I mentioned? – handler's handle – 2017-01-25T06:06:39.463
1
What textbook are you using that says swapping and suspension are synonymous? A process can be suspended due to waiting on I/O (disk/memory) but not be swapped. A swap can happen if the OS decides the process doesn't need to reside in main memory for one reason or another (process not used in a while, not enough memory), but whether or not the PCB is moved is OS dependent ..
– txtechhelp – 2017-01-25T07:41:46.323@txtechhelp Thanks for the response. My textbook specifies that a process waiting on I/O is in the "blocked" state. I've only just begun reading about processes, so perhaps It will further clarify these differences in later chapters. So whether the PCB is swapped into secondary memory along with the rest of the process is dependent on the OS? – handler's handle – 2017-01-25T07:47:45.010
1It sounds like the book will clarify later and is just trying to simplify things in the beginning so as not to overwhelm; for example, you can disable swap space on OSes, as well, a lot of embedded systems don't have a swap, yet the OS will still put processes in a "suspended" (or "blocked") state. Process management is one of the main functions of an OS and thus differs from OS to OS; even between similar OS's (e.g. between variations of Windows, or Linux or Mac), so a direct answer to if the PCB is swapped depends on OS. – txtechhelp – 2017-01-25T07:57:11.177
@txtechhelp In that case, you've answered my question. Thank you again for the assistance. :) – handler's handle – 2017-01-25T08:11:49.790
Instead of using an edit you could formulate it as an answer, post it as such and accept it. – Seth – 2017-01-25T11:20:37.497
This question is ill-defined. The PCB is an abstract concept; as txtechhelp says, implementation details vary from OS to OS. Note that Wikipedia says, “At least part of the process control data structure is always … in main memory”. For example, in Unix, the conceptual PCB is divided into two parts: the
– Scott – 2017-09-28T02:34:19.697proc
structure, which is always in memory, and theuser
structure, which can be paged / swapped out to secondary storage when the process is. So there is no single answer to this question as written.