Process Creation Assignment
Project objective:
Compare the performance of process creation and destruction when implemented with and without linked lists.
Overview:
Method 1 of the process creation hierarchy uses linked lists to keep track of child processes as described in section 5.1 (within Week 5 – Class 9 and 10) The process control block, subsection The PCB data structure.
For the purposes of performance evaluation, the PCBs are simplified as follows:
a. Implementation of the table of all the PCBs is an array of size n.
b. Each process is referred to by a PCB index, 0 through n-1.
c. Each PCB is a structure consisting of only the two fields:
1. Parent: a PCB index corresponding to the process's creator.
2. Children: a pointer to a linked list, where each list element contains the PCB index of one child process.
The necessary functions are simplified as follows: a. Create(p) represents the create function executed by process PCB
[p]. The function creates a new child process PCB
[q] of process PCB[p] by performing the following tasks:
1. Allocate a free PCB[q].
2. Record the parent's index, p, in PCB[q].
3. Initialize the list of children of PCB[q] as empty.
4. Create a new link containing the child's index q and appending the link to the linked list of PCB[p]. b. Destroy(p) represents the destroy function executed by process PCB[p]. The function recursively destroys all descendent processes (child, grandchild, etc.) of process PCB[p] by performing the following tasks for each element q on the linked list of children of PCB[p]: 1. Destroy(q). /* recursively destroy all descendants. */ 2. Free PCB[q]. 3. Deallocate the element q from the linked list. Method 2 of the same process creation hierarchy uses no linked lists. Instead, each PCB contains the 4 integer fields parent, first_child, younger_sibling, and older_sibling, as described in the subsection Avoiding linked lists.
Get Free Quote!
402 Experts Online