fork Vs. spwan
what is diffenrence between spawn and fork ?
"fork() system call spawns the processess" what is mean by this sentence. |
AFAIK "spawns" means "creates" with the added implication that every new process is the child of a previous process (except for the first!).
The way that a process creates a new process is via the fork (or vfork) system call. On receiving the fork call, the kernel creates a new process that is an exact duplicate of the parent except for the PID and the return value from the fork call (there may be other differences I have forgotten). Both processes (parent and child) examine the return form the fork call to identify which one they are and then ... whatever the programmer decided -- typically the child executes a system call from the execve family. |
that sounds like a homework question , and should be in the textbook .
|
All times are GMT -5. The time now is 10:36 PM. |