- Trending Categories
- 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
Difference Between fork() and vfork()
In this post, we will understand the difference between system calls fork and vfork −
The ‘fork’ system call
In this system call, the child and parent process have separate memory spaces.
The child and parent process are executed simultaneously.
This call uses the copy-on-write as alternative.
Child process doesn’t have the ability to suspend execution of the parent process in this system call.
The page of one process doesn’t get affected by the page of other process.
It is more frequently used.
No address space is wasted.
If the child process alters the page in the address space, it is not visible to the parent process.
The ‘vfork’ system call
In this system call, the parent process and child process share the same address space.
Once the child process has been executed, the parent process begins the execution.
This system call doesn’t use copy-on-write technique.
The child process suspends the execution of the parent process in this system call.
The page of one process gets affected by the page of another process.
It is less frequently used.
No address space is wasted.
If the child process alters the page in the address space, it can be seen by the parent process.