User Mode vs Kernel Mode
- User mode has mode bit = 1
- Kernel mode has mode bit = 0
- Applications used by the users run in user mode
- All core functionalities and drivers of OS run in kernel mode.
- Processor keeps switching between user and kernel mode.
- System calls are invoked to switch from user mode to kernel mode. A trap is generated by system call and shifts the process into kernel mode.
- The system call is executed in kernel mode and returns the result back into user mode.
User Level Thread vs Kernel Level Thread
User Level Thread | Kernel Level Thread |
1. Managed by User level library. | 1. Managed by OS. |
2. Typically fast. | 2. Slower than user level. |
3. Context switching is faster. | 3. Context switching is slower. |
4. If one user level thread performs blocking operation, then entire process gets blocked. | 4. If one kernel level thread blocked, it doesn't affect other threads. |
Conclusion
You can read other articles written by me through these links.
Operating System Series
1. Introduction & Types of OS
2. Process States & Lifecycle
3. System Calls
4. User Mode vs Kernel Mode
5. CPU Process Scheduling
6. Process Synchronization
7. Deadlocks
8. Memory Management
9. Disk Management & Scheduling
10. File System in OS
11. Protection & Security
System Design Series
Introduction To Parallel Computing
Deep Dive Into Virtualization
Insights Into Distributed Computing
Cloud Computing Series
1. Cloud Service Models
2. Cloud Deployment Models
3. Cloud Security
4. Cloud Architecture
5. Cloud Storage
6. Networking In The Cloud
7. Cloud Cost Management
8. DevOps In Cloud & CI/CD
9. Serverless Computing
10. Container Orchestration
11. Cloud Migration
12. Cloud Monitoring & Management
13. Edge Computing In Cloud
14. Machine Learning In Cloud
Computer Networking Series
1. Computer Networking Fundamentals
2. OSI Model
3. TCP/IP Model : Application Layer
4. TCP/IP Model : Transport Layer
5. TCP/IP Model : Network Layer
6. TCP/IP Model : Data Link Layer
Version Control Series
1. Complete Guide to Git Commands
2. Create & Merge Pull Requests
3. Making Open Source Contributions
Linux
Complete Guide to Linux Commands
Thanks For Reading! ๐
Garvit Singh