Os 4
Os 4
Process Architecture
• Stack: The Stack stores temporary data like function parameters,
returns addresses, and local variables.
• Heap Allocates memory, which may be processed during its run
time.
• Data: It contains the variable.
• Text:
Text Section includes the current activity,
Process States
Process States
Diagram
A process state is a condition of the process at a specific instant of time.
It also defines the current position of the process.
After completing every step, all the resources are used by a process,
and memory becomes free.
Process Control Block (PCB)
Every process is represented in the operating system by a process
control block, which is also called a task control block.
The process can be split down into so many threads. For example, in a browser, many tabs
can be viewed as threads. MS Word uses many threads - formatting text from one thread,
processing input from another thread, etc.
Need of Thread:
o It takes far less time to create a new thread in an existing process than to create
a new process.
o Threads can share the common data, they do not need to use Inter- Process
communication.
o It takes less time to terminate a thread than a process.
o Enhanced throughput of the system: When the process is split into many
threads, and each thread is treated as a job, the number of jobs done in the unit
time increases. That is why the throughput of the system also increases.
o Responsiveness: When the process is split into several threads, and when a
thread completes its execution, that process can be responded to as soon as
possible.
o Resource sharing: Resources can be shared between all threads within a
process, such as code, data, and files. Note: The stack and register cannot be
shared between threads. There is a stack and register for each thread.
o