Operations on Processes are explained as follows
The processes in the system execute concurrently and they should be created and deleted dynamically therefore the operating system should provide the mechanism for the creation and deletion of the processes.
Process Creation
A process might create various new processes by means of a create-process system call during the course of its execution. The creating process is known as a parent process while the new processes are known as the children of that process. Each of these new processes might in turn create other processes, forming the tree of processes. The figure drawn below shows partially the process tree in a UNIX/Linux system.
Figure of Process tree in UNIX/Linux
In general, a process will require certain resources (like memory files, CPU time, I/O devices) to accomplish the task. When the process creates a sub process, it is also called as a child, which sub process might be able to obtain its resources directly from the operating system or might be constrained to a subset of resources of the parent process. The parent might have to partition its resources among a number of of its children. Restricting a process to a subset of the parent's resources prevents a process from overloading of the system by creating so many sub processes.
When the process is created it obtains additionally to various physical and logical resources, initialization data which might be passed along from the parent process to the child process. When a process creates a new process, two cases exist in terms of execution:
1. The parent continues to carry out concurrently with its children.
2. The parent halts until some or all of its children have terminated.
There are again two possibilities in terms of the address space of the new process which are given as follows:
1. The child process is the carbon copy of the parent process.
2. The child process has the program loaded into it.
So as to consider these different implementations let us consider a UNIX operating system. In UNIX its process identifier identifies a process of it, which is a unique integer. A new process is formed by fork system call. The new process consists of the copy of the address space of its parent. This mechanism permits the parent process to communicate easily with child process. Both the processes continue the execution at the instruction after the fork call, with one difference, the return code for the fork system call is zero for child process, while the process identifier of the child is returned back to the parent process.
Usually the execlp system call is used after the fork system call by one of the two processes to replace the process' memory space with a new program. The execlp system call loads a binary file in memory -destroying the memory image of the program containing the execlp system call.-and starts its implementation. In this way, the two processes are able to communicate with each other and then go in their separate ways. The parent can then produce more children, or if it has nothing else to do while the child runs, it can issue the wait system call to move itself off the ready queue until the termination of the child occurs. The parent waits for the child procedure to terminate, and then it resumes from the call to wait where it completes using the exit system call.
Process termination is described as follows
A process terminates when it finishes executing its final statement and then asks the operating system to delete it by calling the exit system call. At that instant, the process may return data to its parent process (by means of the wait system call). All the resources of the process comprising the physical and virtual memory, open the files and I/O buffers - are de allocated by operating system.
Termination happens under additional circumstances. A process can make the termination of another by means of an appropriate system call (like abort). Generally only the parent of the process which is to be terminated can invoke this system call. As a result parents require to know the identities of its children, and hence when one process creates another process, the identity of the newly formed process is passed to the parent.
A parent may terminate the execution of one of its children for the number of reasons, which are as follows:
ƒ The child has exceeded its use of some of the resources which it has been allocated. This needs the parent to have the mechanism to inspect the state of its children.
ƒ The task assigned to the child is no longer needed.
ƒ The parent is exiting, and the operating system does not permit a child to continue
if the parent terminates. On such a system, if the process terminates either normally or abnormally, then all its children should also be terminated. This phenomenon referred as the cascading termination, it is normally initiated by the operating system. Considering an instance from UNIX, we can terminate the process by using the exit
system call, its parent process might wait for the termination of a child process by using the wait system call. The wait system call returns back the process identifier of a terminated child, so that parent can tell which of its possibly various children has terminated. If the parent terminates though all its children have been assigned their new parent, the init process. Thus the children still have a parent to collect their status and their execution statistics.
Email based Operating System assignment help - homework help at Expertsmind
Are you searching Operating System expert for help with Operations on Processes questions? Operations on Processes topic is not easier to learn without external help? We at www.expertsmind.com offer finest service of operating system assignment help and operating system homework help. Live experts are available for 24x7 hours helping students in their Operations on Processes related problems. We provide step by step Operations on Processes question's answers with 100% plagiarism free content. We prepare quality content and notes for Operations on Processes topic under operating system theory and study material. These are avail for subscribed users and they can get advantages anytime.
Why Expertsmind for assignment help
- Higher degree holder and experienced tutors network
- Punctuality and responsibility of work
- Quality solution with 100% plagiarism free answers
- Time on Delivery
- Privacy of information and details
- Excellence in solving operating system questions in excels and word format.
- Best tutoring assistance 24x7 hours