
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Process Synchronization in Linux
Process synchronization in Linux involves providing a time slice for each process so that they get the required time for execution.
The process can be created using the fork() command in Linux. The creating process is called the parent process and the created process is the child process. A child process can have only one parent but a parent process may have many children. Both the parent and child processes have the same memory image, open files and environment strings. However, they have distinct address spaces.
A diagram that demonstrates the fork() command is given as follows −
Orphan Processes
There are some processes that are still running even though their parent process has terminated or finished. These are known as orphan processes.Processes can be orphaned intentionally or unintentionally. An intentionally orphaned process runs in the background without any manual support. This is usually done to start an indefinitely running service or to complete a long-running job without user attention.
An unintentionally orphaned process is created when its parent process crashes or terminates. Unintentional orphan processes can be avoided using the process group mechanism.
Daemon Processes
Some processes run in the background and are not in the direct control of the user. These are known as daemon processes. These processes are usually started when the system is bootstrapped and they terminate when the system is shut down.
Usually the daemon processes have a parent process that is the init process. This is because the init process usually adopts the daemon process after the parent process forks the daemon process and terminates.
- Related Questions & Answers
- Process Synchronization in Windows
- Process Synchronization in Solaris
- Process Synchronization in C/C++
- Linux Process Monitoring
- Process Representation in Linux System
- What is Zombie Process in Linux?
- How to create a process in Linux?
- Init process on UNIX and Linux systems
- Hardware Synchronization
- Prevent fork bomb by limiting user process in linux
- How to Kill a Process by Name in Linux?
- What are the process states in Windows and Linux?
- Thread Synchronization in C#
- Channel synchronization in Golang
- Count the number of threads in a process on linux