Explain the difference between how fork and vfork unix


Explain the difference between how fork() and vfork() UNIX system calls calls work, from Virtual memory managementprospective. i.e., explain how the way these system calls work affects how the memory management system deals with them. (relevant to Section  9.1-3)

Process creation using the fork() system call may initially bypass the need for demand paging by using a technique similar to page sharing. the fork() system call creates a child process that is a duplicate of its parent. Traditionally, fork() worked by creating a copy of the parent's address space for the child, duplicating the pages belonging to the parent.

However, considering that many child processes invoke the exec() system call immediately after creation, the copying of the parent's address space may be unnecessary. Several versions of UNIX (including Solaris and Linux) provide a variation of the fork() system call-vfork() (for virtual memory fork)-that operates differently from fork() with copy-on-write. With vfork(), the parent process is suspended, and the child process uses the address space of the parent. Because vfork() does not use copy-on-write, if the child process changes any pages of the parent's address space, the altered pages will be visible to the parent once it resumes. Therefore, vfork() must be used with caution to ensure that the child process does not modify the address space of the parent. vfork() is intended to be used when the child process calls exec() immediately after creation. Because no copying of pages takes place, vfork() is an extremely efficient method of process creation and is sometimes used to implement UNIX command-line shell interfaces.

Assume the following page reference sequence. (1, 2, 3, 5, 6, 2, 3, 4, 5, 6, 1, 2, 1, 6, 7). Calculate the number of page faults as well as the content of the memory frames at the end of the references for the following 6 cases (scenarios): the memory system contains 1, 2, 3, 4, 5, or 6 frames. Draw curve that show Number of Frames on the X axis and number of page faults on the Y axis. Show your work in a separate page of paper? (relevant to Section  9.4)  

Reference sequence

1

2

3

5

6

2

3

4

5

6

1

2

1

6

7

Page Fault

1

1

1

 

5

6

2

 

6

1

1

2

 

7

7

 

2

2

 

3

5

3

 

5

 

2

1

 

 

6

 

 

3

 

1

1

4

 

4

 

 

1

 

 

 

Request for Solution File

Ask an Expert for Answer!!
Operating System: Explain the difference between how fork and vfork unix
Reference No:- TGS01389789

Expected delivery within 24 Hours