- 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.
- Related Articles
- Difference between fork() and exec() in C
- C program to demonstrate fork() and pipe()
- fork() in C
- Difference Between & and &&
- C vs BASH Fork bomb?
- The fork() Function in Perl
- Calculation in parent and child process using fork() in C++
- Difference between Voltage Drop and Potential Difference
- Difference between JCoClient and JCoDestination
- Difference between localhost and 127.0.0.1?
- Difference between Process and Thread
- Difference between Bootstrap and AngularJS.
- Difference between C and C++.
- Difference between Java and JavaScript.
- Difference between NodeJS and AngularJS
