a. Our view of a process in memory
Stack <area to grow> Heap Data Text/Code
We will discuss more about this in memory management.
b. The real view of processes
- When we talk about processes in the ready queue we are referring to all processes in memory, as opposed to secondary storage (virtual memory).
- The ready queue can be implemented as a list/array, queue, or priority queue of PCB (described later in this page), depending on the algorithm used.
- The waiting queue is an array. An event or I/O that is waited on has an ID associated with the index of the PCB that it is waiting for it.
c. Process Control Block (PCB)
- Context Switching is the most important thing when it comes to insuring success in the process life cycle. It is the process of freeze drying a process in the running state and loading another one in.
Process State Process ID (PID) Program Counter CPU Registers CPU Scheduling Info Memory Limits Memory Management Info Open Files
- Process state: Can be either new, running, ready, waiting, halted, etc.
- Program Counter: Helps you remember where you were
- CPU Register: All of them need to be stored to allow context switch
- Scheduling info: Priority, etc.
- Memory Limit: Base and limit register
- Memory management: to be discussed later
- I/O: The ones held and the status associated with it.
- Accounting information: Things like how long has it been running, etc. (stuff apps like top needs)