Chapter 3

Cards (45)

  • Process is a program in execution. While programs are written in text file and executed to become a process
  • When the program is loaded into the main memory, it becomes a process
  • Two-state model - the simplest model is based on the fact that process is either being executed by the processor or is not. PROCESS STATES: Running, not running
  • Three-state model:model which reposes on the idea that aside from the state whereby the process is running or processing inside the CPU, the process is either waiting to get into the processor or busy doing I/O activities. STATES: Running, Ready, Blocked/Waiting
  • Running - process is currently being executed by a processor
  • Ready - process is ready to execute when a processor becomesavailable.
  • Blocked or Waiting - process is waiting for a specific event tooccur before it can proceed.
  • Five-state model: STATES: New, Ready, Running, Waiting/Blocked, Terminated
  • New - process is being created. From secondary memory to main memory
  • Terminated - finish execution. remove from memory and go back to secondary storage
  • Examples of process creation: System boot-up, Batch system initialization, human user cretion, process spawning
  • Process Termination Example: Normal completion, time limit exceeded, memory unavailable, bounds violation, protection error, arithmetic error, invalid instruction, privileged instruction, OS intervention, Data misuse, Parent termination
  • Normal completion - the process executes an OS servicecall to indicate that it has completed running
  • Time limit exceeded - the process is terminated themoment it exceed the maximum time for a user to performprocess.
  • Memory unavailable - the process requires more memorythan the system can provide.
  • Bounds violation - the process tries to access a memorylocation that it is not allowed to access
  • Protection Error - the process attempts to use a resourcesuch as a file that it is not allowed to use, or it tries to useit in an improper fashion, such as writing to a read-onlyfile.
  • Arithmetic Error - This type of process terminating erroroccurs whenever an illegal computation is made in thecomputer system, such as undefined computation or anextremely large numerical input to a limited capacity
  • Invalid Instruction - the process attempts to execute anonexistent instruction
  • Privileged Instruction - the process attempts to use aninstruction reserved for the operating system.
  • Data Misuse - a piece of data is of the wrong type or is notinitialized.
  • OS Intervention - for some reason, the operating systemhas terminated the process.
  • Parent Termination - when a parent terminates, theoperating system may automatically terminate all of theoffspring of that parent
  • types of process schedulers: long term scheduler, short term scheduler, medium term scheduler
  • Long-term Scheduler - controls the number of jobs that goes inside the memory from the secondary storage. new state to ready state
  • Short-term Scheduler - selects jobs from the main memory to beallocated to the CPU. ready state to running state
  • Medium-term Scheduler - removes a job from the main memory in orderto create space/vacant in the memory where the needed process can beloaded. the removed process goes into virtual memory in secondary storage. still in ready state
  • long term scheduler aka admission scheduler
  • short term scheduler aka cpu scheduler
  • medium term scheduler aka swapper
  • system boot up - when the computer is turned on it creates process. ex BIOS is a process
  • Human user creation - most common process creation
  • batch system initialization - preset programs after booting. loading of services and startup programs
  • process spawning - not created by user but rather the process itself creates or call another process
  • Preemptive process can be interrupt while in execution
  • preemption is the actual suspension of the process because of an interruption
  • non-preemptive process- once the process occupied the cpu, it cant be interrupted
  • CPU scheduling algorithm is the technique used by the short term scheduler to handle task
  • cpu scheduling algorithm is divided into non-preemptive algorithm and preemptive algorithm
  • Non-preemptive algorithm example: FCFS, SJF, NPP