|
Process State Diagram Process Control Block (PCB)
|
Page | 2/7 | Date | 02.08.2022 | Size | 0.57 Mb. | | #59263 |
| Lecture 2 Processes Lecture 1 Introduction Process Control Block (PCB) - Each process is represented on the OS by a PCB
- It is the data structure used by the OS
- Process state – new, running, waiting etc
- Program counter – address of next instruction to
- CPU registers – indicates general purpose register, index registers and accumulators etc.
- Memory management information – include such information as the base and limit register, page tables or segment tables in memory
- I/O status information – I/O requests, I/O devices allocated , a list of open files
- Accounting information – CPU used, clock time elapsed since start, time limits
Threads - Is a lightweight process
- Basic unit of CPU utilisation
- Consists of :
- Thread States
- bornState :A thread is just created
- readyState :The thread is waiting for CPU
- Running :System assigns the processor to the thread
- Sleep: :A sleeping thread becomes ready after the designated sleep time expires
- Dead :The execution of the thread is finished
Process vs Thead - Process
- Is heavy weight or resource intensive
- process takes more time to create
- Execution is very slow
- Cant share the same memory area
- Communication between two processes is difficult
- Thread
- Is light weight, taking lesser resources
- Takes less time to create
- Execution is very fast
- Threads can share same memory area
- Communication between two threads is easy
Multithreading - Is when a number of thread execute at the same time within a process
- In a multithreaded program, even when some portion of it is blocked, the whole program is not blocked
- The rest of the program continues running if multiple CPUs are available
- Multithreading therefore gives the best performance
- Multithreading can simplify code and increase efficiency
- Kernels are generally multithreaded
Share with your friends: |
The database is protected by copyright ©ininet.org 2024
send message
|
|