Date post: | 25-May-2015 |
Category: |
Technology |
Upload: | federal-urdu-university-of-arts-science-and-technology |
View: | 694 times |
Download: | 1 times |
ProcessAteeq zada khan
03002121899
What is a Process?
• A process is a program during execution.
• A process is the basic unit of execution in an operating system.
• Different processes may run different instances of the same program.
• At a minimum, process execution requires following resources:• Memory to contain the program code and data.
• A set of CPU registers to support execution.
Process Creation
• The OS builds a data structure to manage the process.
• Traditionally, the OS created all processes
• But it can be useful to let a running process create another.
• This action is called process spawning
• Parent Process is the original, creating process.
• Child Process is the new process.
Process Termination
• There must be some way that a process can indicate completion.
• This indication may be:• A HALT instruction generating an interrupt
alert to the OS.
• A user action (e.g. log off, quitting an application)
• A fault or error
• Parent process terminating
Process Life Cycle
• Processes are always either executing, waiting to execute or blocked waiting for an event to occur.
• As a process executes, it changes state:• new: The process is being created.
• running: Instructions are being executed.
• waiting: The process is waiting for some event to occur.
• ready: The process is waiting to be assigned to a processor
• terminated: The process has finished execution.
Five State Process Model
Two Queues Diagram
Multiple Blocked Queues
Suspended Processes
• Processor is faster than I/O so all processes could be waiting for I/O device.• Swap these processes to disk to free up more
memory and use processor on more processes..
• Blocked state becomes suspend state when swapped to disk.• Two new states
• Blocked/Suspend• Ready/Suspend
One Suspend State
Two Suspend States
Reasons
• Swapping:
• The OS need to make space for execute the process that in ready state.
• OS Reason:
• Operating system suspects the process faulty or causing a problem.
Questions ?