Hey all, Welcome to Geeksforjobs
- Threads are a single sequence stream within a process.
- This process has some properties so they are called a light process.
- Those are executed one after the other but give the illusion as if they are executed in parallel.
- These are not independent of each other as sharing code, data, OS resources.
- Each thread is
- Set register
- Stack space
Types of threads
USER LEVEL THREADS (ULT)
- Implemented in a user-level library
- Thread switching does not need to call the OS and create a bottleneck for the kernel
Benefits of ULT
- This can be implemented on an OS that does not support multithreading
- Since the simple representation is the only PC in the thread, register set, stack space
- Simple to build since kernel intervention
- Co-ordination between non-thread and kernel
- If a thread causes a page fault, the entire process is blocked
Canal Level Threads (KLT)
- The kernel has a thread table and a process table
- Slow and inefficient
- This requires a thread control block so this is an overhead