Lompat ke konten Lompat ke sidebar Lompat ke footer

CS604 Assignment 1 Spring 2021 || Easy way to solve Assignment

 




File Here
Child Process:

Copy on Write fork() Demand paging is used when reading a file from disk into memory and such files may include binary executables. However, process creation using fork() may bypass initially the need for demand paging by using a technique similar to page sharing. This technique provides for rapid process creation and minimizes the number of new pages that must be allocated to newly created processes. 

Recall the fork() system call creates a child process as 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. Alternatively we can use a technique known as copy on write. This works by allowing the parent and child processes to initially share the same pages. These shared pages are marked as copy-on-write pages, meaning that if either process writes to a shared page, a copy of the shared page is created. For example assume a child process attempts to modify a page containing portions of the stack; the operating system recognizes this as a copy-on-write page. The operating system will then create a copy of this page mapping it to the address space of the child process.  Therefore the child page will modify its copied page, and not the page belonging to the parent process. Using the copy-on-write technique it is obvious that only the pages that are modified by either process are copied; all non modified pages may be shared by the parent and the child processes. Note that only pages that may be modified are marked as copy-on-write. Pages that cannot be modified (i.e. pages containing executable code) may be shared by the parent and the child. Copy-on-write is a common technique used by several operating systems such as Linux, Solaris 2 and Windows 2000.

Parent Process:

The parent may have to partition its resources among several of its children. Restricting a process to a subset of the parent’s resources prevents a process from overloading the system by creating too many sub processes.  When a process is created it obtains in addition to various physical and logical resources, initialization data that may be passed along from the parent process to the child process. When a process creates a new process, two possibilities exist in terms of execution:

1. The parent continues to execute concurrently with its children. 

2. The parent waits until some or all of its children have terminated. There are also two possibilities in terms of the address space of the new process: 

1. The child process is a duplicate of the parent process. 

2. The child process has a program loaded into it. 

Posting Komentar untuk "CS604 Assignment 1 Spring 2021 || Easy way to solve Assignment"