Please enable JavaScript.
Coggle requires JavaScript to display documents.
Process Management - Coggle Diagram
-
Process is a program in execution.
- Process progresses in sequential passion
Parts of a process are:
- Program Counter
- Stack (local vars)
- Data section (global vars)
- Text (code)
- Heap (dynamic)
- Files
File descriptors in processes are independent
- When two processes' file descriptor are pointing to the same file, closing it from one process doesn't affect the other.
Children Process
- Parent process can create a child process
- Child process can inherit fd, shared memory, and system queues
- Parent and child run concurrently, or the Parent can use the wait system call to wait for the child to terminate
- Any process is a child of a kernel
Standard I/O (cin, cout, cerr)
Ultimately, the cin, cout, cerr of any process is actually copied from the file descriptors of the kernel!
Process Control Block (PCB) stores information regarding each process
- State
- Program Counter
- CPU registers
- CPU scheduling info
- Memory info
- Accounting info
- I/O status
States
- new: process created
- running: instructions are being executed
- waiting: waiting for some event
- ready: ready to be assigned to a processor
- terminated: process has done with instructions
State Transition
Ready -> Running by scheduler
Running -> Waiting I/O or event wait
Waiting -> Ready I/O or event complete
Thread
- created by a process (1 or more)
- is a lightweight
- no Context Switch (no overheads)
Individual Resources for each thread
Shared Resources in the same parent process
- Address space
- Code
- Data
- Files
- Heap
-
Better Utilization of multiprocessor architecture
- Each thread can individually utilize the core of the multiprocessor
- Shared Resources can be placed in the L3 cache as it is small enough to fit in.
- Individual Resources can be placed in L1 which speeds up the entire process
- If not all the core is in use by threads of a process, another process may also come into the CPU to fill in the space
-
-