How can a parent and child process communicate?Ī parent and child can communicate through any of the normal inter-process communication schemes (pipes, sockets, message queues, shared memory), but also have some special ways to communicate that take advantage of their relationship as a parent and child. To be able to get this information, the parent calls `wait ()’ In the interval between the child terminating and the parent calling `wait ()’, the child is said to be a `zombie’ (If you do `ps’, the child will have a `Z’ in its status field to indicate this.) When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it – for example, the parent may need to check the child’s exit status. Zombie: The process is dead but has not been removed from the process table. Stopped: The process has been stopped, usually by receiving a signal. Waiting: The process is waiting for an event or for a resource. Running: The process is either running or it is ready to run. Unix processes have the following states: Once a process, usually the parent process, reaps the exit status of the zombie, then the process is destroyed.Īs a process executes it changes state according to its circumstances. A Unix process is created in the idle state and is then moved between ready to run, running, and possibly waiting (or sleeping), until it exits and becomes a zombie. This is a small experiment to show the life cycle of a Unix process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |