LinuxQuestions.org
Help answer threads with 0 replies.
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 01-09-2009, 02:06 AM   #1
kannandv
LQ Newbie
 
Registered: Jan 2009
Posts: 5

Rep: Reputation: 0
Post need info on fork


can anyone explain id there any diff btw fork and process?.

when did a fork gets invoked?
 
Old 01-09-2009, 02:12 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Loosely speaking, a process is a running program and its env. When you fork(), the system creates a new process as a copy of the current process, including data and code.
There's an explanation here http://perldoc.perl.org/functions/fork.html, with link to examples http://perldoc.perl.org/perlipc.html.
See also the man pages: man fork
 
Old 01-09-2009, 02:22 AM   #3
kannandv
LQ Newbie
 
Registered: Jan 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks fr ur reply chrism01!.
Can you please tell me that 'if the fork can be called automatically' by process?.
 
Old 01-09-2009, 04:16 AM   #4
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 32
Quote:
Originally Posted by kannandv View Post
if the fork can be called automatically' by process?.
what is this automatically ????

please be more precise what you wanted to get clarified.
 
Old 01-09-2009, 06:04 AM   #5
kannandv
LQ Newbie
 
Registered: Jan 2009
Posts: 5

Original Poster
Rep: Reputation: 0
A java process is running with pid as 123 in solaris.
when i access my application, the application thread did'nt responded.
when check the application process, it shows to java process like this,
UID PID PPID CMD
xxx 123 1 sss
xxx 124 123 sss

some others says that the parent process (PID :123) fork the child process.
i need to know in wht scenario, this kind of child process gets created?.
note : In the java application there is no 'runtime.exe' calls.
 
Old 01-09-2009, 06:13 AM   #6
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 32
Please tell me first, Are you using fork() function call in your application?

Last edited by chakka.lokesh; 01-09-2009 at 06:15 AM.
 
Old 01-09-2009, 07:55 AM   #7
kannandv
LQ Newbie
 
Registered: Jan 2009
Posts: 5

Original Poster
Rep: Reputation: 0
no fork() is used in the application.
its a java application lanched via the solaris exec command.
 
Old 01-09-2009, 08:19 AM   #8
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 32
Quote:
Originally Posted by kannandv View Post
no fork() is used in the application.
its a java application lanched via the solaris exec command.
then that java related library might have started a new thread.
 
Old 01-09-2009, 08:21 AM   #9
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 32
Quote:
Originally Posted by kannandv View Post
can anyone explain id there any diff btw fork and process?.
process is a file in execution.
fork is a function call used to start a new child process.

both are entirely different
 
Old 01-09-2009, 08:23 AM   #10
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 32
Quote:
Originally Posted by kannandv View Post
when did a fork gets invoked?
when ever u use a fork function in your application it will get invoked or the libraries which you are using may also internally use it.
 
  


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
Gnome/Nautilus issues Beagle-Tracker, file transfer info, replace file info, popup. Mysticle31 Linux - Software 0 01-08-2008 06:30 PM
PPC (PowerPC) G4: Altivec & SMP Support: info, etc.; also, Mac Mini info, etc. HowDoIProgramIt Linux - Hardware 0 05-29-2007 02:19 PM
info problem "info: dir: No such file or directory" EAD Linux - Software 0 03-22-2006 03:16 PM
Convert an info file(bash.info.gz) to a single html file Darwish Linux - Software 2 09-24-2005 07:51 AM
fork() in c++ deveraux83 Programming 5 11-13-2004 04:12 PM


All times are GMT -5. The time now is 06:48 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