Please enable JavaScript.
Coggle requires JavaScript to display documents.
THREADS, :fire: Virtual Memory is concerned with processes and not with…
THREADS
A Lightweight process or a segment of a process
A process may have multiple threads.
- Besides having the parent's PCB it also has it's own TCB Thread Control Block
Resource Sharing: Thread use the same data, code and OS resources therefore they aren't independent and CONTEXT SWITCHING is faster in threads than processes.
-
Types of Threads
User-Level Threads
- User threads are implemented by users.
- Operating System doesn’t recognize user level threads and manages them as if they were single-threaded processes.
- Implementation of user level threads is easy.
- Context Switch Time is Less
It doesn't require hardware support as it is managed by the user and implemented by the libraries.
- If one user level thread performs blocking operation then entire process will be blocked.
ADVANTAGES
- Can be implemented on an OS that doesn’t support multithreading.
DISADVANTAGES
- If one thread causes a page fault, the entire process blocks.
- No or less co-ordination among the threads and Kernel.
Kernel Level Threads
- Kernel threads are implemented by Operating System (OS).
- Kernel threads are recognized by Operating System.
- Implementation of Kernel thread is complicated.
- Context switch time is more.
It requires hardware support
- If one kernel thread perform blocking operation then another thread can continue execution.
ADVANTAGES
Since kernel has full knowledge about the threads in the system, scheduler may decide to give more time to processes having large number of threads.
DISADVANTAGES
- Slow and inefficient.
- It requires thread control block so it is an overhead.
-
-
-