- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the five process states in the Linux kernel ?
The five process states in the Linux kernel are as follows −
Running − This is a state where a process is either in running or ready to run. It is the most active state of all. In this state, the process is getting system resources.
Interruptible − This state is a blocked state of a process which waits for an event or a particular time slot.
Uninterruptible − It is also a blocked state and it has a timeout value before going to sleep. It will awake when the timeout value sets off.
Stopped − Once the process is completed, this state occurs and this process can be restarted.
Zombie − It is a dead process and it will be terminated and the information will still be available in the process table.
The five process states in Linux Kernel are depicted below −
The purpose of fork(), exec() and wait() are as follows −
fork() − The fork() system call is used to create a new process (child's) that is identical to the old process(parent). The kernel will assign a new process structure to the child process. If the return value is 0, then it belongs to the child process, or else it belongs to the parent process.
exec() − The exec() system call replaces the currently running process with a new process.
wait() − The wait() system call lets the parent process wait until all child processes have been completed. The wait() call returns immediately if the child process terminates.