LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2012, 01:28 AM   #1
anandg111
Member
 
Registered: Jan 2012
Posts: 56

Rep: Reputation: Disabled
Smile fork Vs. spwan


what is diffenrence between spawn and fork ?

"fork() system call spawns the processess" what is mean by this sentence.
 
Old 03-11-2012, 10:13 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
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.
 
Old 03-12-2012, 12:18 AM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
that sounds like a homework question , and should be in the textbook .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding Fork() sankumar Programming 2 12-19-2008 09:02 AM
fork() in c++ deveraux83 Programming 5 11-13-2004 04:12 PM
fork() vibhory2j Linux - Software 1 05-24-2004 05:11 AM
about fork eshwar_ind Programming 5 02-11-2004 04:38 AM
over-fork luzi82 Linux - Newbie 2 01-02-2004 07:55 AM


All times are GMT -5. The time now is 08:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration