04-01-2013, 04:26 PM
Process and Process Management
1Process and Process.pdf (Size: 929.75 KB / Downloads: 58)
What is a Process?
Recall from Module 1 that a process is a program in
execution.
A process in execution needs resources like processing
resource, memory and IO resource.
Imagine a program written in C – my_prog.c.
After compilation we get an executable.
If we now give a command like ./a.out it becomes a
process.
Multi-programming and Time Sharing
Let us consider a system with only one processor
and one user running one program: prog_1.
IO and processing will happen alternately.
When IO is required, say keyboard input, the processor
idles. This is because we are nearly a million times
slower than the processor !!!
Multi-programming Support in OS
Disadvantage - overhead faced while switching the
context of use of the processor.
Advantage - computer resource utilization is
improved.
Advantage – memory utilization is improved with
multiple processes residing in main memory.
A system would give maximum throughput when all
its components are busy all the time.
Response Time : Some Facts
In a time sharing system, it is important to achieve an
acceptable response time.
In a plant with an on-line system, system devices
are continuously monitored : to determine the
criticality of a plant condition. Come to think of it
even a library system is an on-line system.
If an online system produces a response time within
acceptable limits, we say it is a real-time system
Choosing a Scheduling Policy
Scheduling policy depends on the nature of operations.
An OS policy may be chosen to suit situations with
specific requirements.
Within a computer system, we need policies to
schedule access to processor, memory, disc, IO and
shared resource (e.g. printers).
Process Context Switching
An OS maintains, and keeps updating, a lot of information
about the resources in use for a running process. For instance,
each process in execution uses the program counter, registers
and other resources within the CPU. So, whenever a process is
switched, the OS moves out, and brings in, considerable
amount of context switching information as shown in the
previous figure. We see that process Px is currently executing
(note that the program counter is pointing in executable code
area of Px).