Hey: here is my Answer is given below, to appreciate my work
please give Positive Rating............
does a zombie process use CPU time true
or false -:
- NO, the Zombie process doesn't use CPU
time.
- a zombie process or defunct process is a process that
has completed execution (via the exit system call) but still has an
entry in the process table: it is a process in the "Terminated
state".
- This occurs for the child processes, where the entry is
still needed to allow the parent process to read its child's exit
status: once the exit status is read via the wait system call, the
zombie's entry is removed from the process table and it is said to
be "reaped".
- A child process always first becomes a zombie before
being removed from the resource table. In most cases, under normal
system operation zombies are immediately waited on by their parent
and then reaped by the system – processes that stay zombies for a
long time are generally an error and cause a resource leak, but the only
resource they occupy is the process table entry – process
ID.
- So, All the memory and resources allocated to a process
are deallocated when the process terminates using the exit() system
call. But the process’s entry in the process table is still
available. This process is now a zombie process.
- The exit status of the zombie process can be read by
the parent process using the wait() system call. After that, the
zombie process is removed from the system. Then the process ID and
the process table entry of the zombie process can be
reused.
- If the parent process does not use the wait() system
call, the zombie process is left in the process table. This creates
a resource leak.
- If the parent process is not running anymore, then the
presence of a zombie process indicates an operating system bug.
This may not be a serious problem if there are a few zombie
processes but under heavier loads, this can create issues for the
system such as running out of process table entries.
Is it true or false that a orphan
process will find a new parent and will not use CPU
time.
- It is false that a orphan
process will find a new parent and will not use CPU time, when the
parent of chid process is terminated/ died then this orphaned child
process is adopted by
special init system process:
the kernel sets the parent to init.
- This operation is called
re-parenting and occurs automatically. Even though technically the
process has the "init" process as its parent, it is still called an
orphan process since the process that originally created it no
longer exists. In other systems orphaned processes are immediately
terminated by the kernel.
- it still use the resources
and CPU time for execution .
- An orphan process is a
process that is still executing, but whose parent has died. When
the parent dies, the orphaned child process is adopted by init or
systemd (process ID 1).
- When orphan processes die,
they do not remain as zombie processes; instead, they are waited on
by init. The result is that a process that is both a zombie and an
orphan will be reaped automatically.
thanks..................