Chapter 3 Processes

  • process: a program in execution
  • A system consists a collection of processes: OS processes executing system code and user processes executing user code.
  • All of these processes can execute concurrently with the CPU multiplexed among them.

3.1 Process Concept

3.1.1 The process

text section contains the program code

process stack contains temporary data (function param, return address, local variables.etc)

data section contains global variables

process may also include a heap, memory that is dynamically allocated during process run time.

  • Program itself is not a process; a program is a passive entity --> file containing a list of instructions stored on a disk;
  • Process is a active entity, with a program counter specifying the next instruction to execute and a set of associated resources.
  • Although two processes may be associated with the same program, they are nevertheless consider TWO separate execution sequence! (ex. user running many copies of Web browser program)

3.1.2 Process state

As process executes, it Changes STATE

  • New: the process is being created
  • Running : the process are being executed
  • Waiting: The process is waiting for some event to occur(such as I/O completion or reception of a signal)
  • Ready: the process is waiting to be assigned to a processor
  • Terminated: The process has finished execution

3.1.3 Process Control block (PCB)

PCB contains info includes:

  • Process state: may be new, ready, running , waiting, halted and so on
  • Program counter: indicates the address of the next instruction to be executed for this process
  • CPU registers: vary in number and type, depending on the computer architecture.
  • CPU scheduling info: includes a process priority, pointers to scheduling queues and other scheduling parameters.
  • Memory-management info: may include the value of teh base and limit registers, the page tables, or the segment tables, depending on the memory system used by the OS
  • Accounting info: includes the amount of CPU and real time used, time limits, account numbers, job or process numbers and so on
  • I/O status info: includes the list of I/O devices allocated to the process, a list of open files and so on.

3.2 Process Scheduling

results matching ""

    No results matching ""