:: Re: [DNG] Doing away with multi-thr…
トップ ページ
このメッセージを削除
このメッセージに返信
著者: KatolaZ
日付:  
To: Edward Bartolo
CC: dng
題目: Re: [DNG] Doing away with multi-threading in my project (netman)
On Sat, Sep 05, 2015 at 08:52:39PM +0100, Edward Bartolo wrote:
> Quote: <<An 'orphaned process' is one whose parent has exited after creating a
> process (that's done via fork and not via execve) and it's not adopted
> by the grand parent but by init.>>
>
> So what is the difference between an "orphaned process", i.e. a
> process whose parent has exited after giving birth to a child process
> and one which replaces the original process effectively giving its
> parent a death sentence?



???????

I think there is here some confusion about process creation. Upon a
fork() the process calling it (the parent) is effectively *copyed*
into a new process (the child). The child is an (almost, up to few
details) *exact* copy of the parent, including the program page (the
code). Hence, by calling execve in the child you are not "giving its
parent a death sentence" but you are simply replacing the progam page
(the code) of the child process. The parent is unaffected by such a
call, because it does not occur in its process space.

I warmly suggest you to have a look to something like "The Linux
Programming Interface":

http://man7.org/tlpi/

Incidentally, the pdf of the chapter related to process creation is
available for download:

http://man7.org/tlpi/download/TLPI-24-Process_Creation.pdf

My2cents

KatolaZ

--
[ Enzo Nicosia aka KatolaZ --- GLUG Catania -- Freaknet Medialab ]
[ me [at] katolaz.homeunix.net -- http://katolaz.homeunix.net -- ]
[ GNU/Linux User:#325780/ICQ UIN: #258332181/GPG key ID 0B5F062F ]
[ Fingerprint: 8E59 D6AA 445E FDB4 A153 3D5A 5F20 B3AE 0B5F 062F ]