top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

OS: What is the orphan process and how it can be created ?

+2 votes
713 views
OS: What is the orphan process and how it can be created ?
posted May 8, 2014 by Ganesh Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+4 votes

Orphan process is the one which has no parent, that is "A process which has not parent process".

At time accidentally parent process get crashed or killed and child process (es) will become orphan processes. Generally when Parent gets killed all its child processes will be linked to or adopted by init process of the uinix.

And if you want to create your own Orphan process you can just use fork() call in your program and it creates a process and and you can exit the main process so the child created will become orphan.

Generally orphan processes are created to do some background activities independently, For Ex: In unix you might have seen daemon processes like syslogd, sshd, these are orphan processes created during boot up to do some specific activities.

You might be thinking no what is the difference between Daemon and Orphan right?

I would say like this "Intentionally created Orphans are called Daemons" and Accidental child processes are Orphans and taken care by Init process of linux.

Hope it will give some basic knowledge about the same now you can google on the same or read some unix internals book if you have any for more detailed knowledge. Happy reading!!!

answer May 8, 2014 by Nagaraja Sadar
Very nice summary
Similar Questions
0 votes
while(true)
{
  sleep(1); /* sleep for 1 second */
  if(getpid()%2 == 0)
  {
     fork();
  }
}

How many no.of processes are created by the end of 12th second, if
time starts from 0th second? Process id's start from 0.

+1 vote

Lets say, I have a system with only 1 core and with Windows OS. Using VMWare I am installing Linux on that. Can I share this core for VM and Base OS?

I mean if we have number of core 4 then in vmware we can assign 2 core. So, 2 Core for Linux and 2 core for windows. But what if I have number of core only 1, or if i have number of core 4 and in vmware I assign 4 core to Linux.

Will it share the core time wise?

...