Re: [gtk-list] fork() / execl()



As the well known Daniel J. Kressin said...
->What are the general rules for fork()ing and execl()ing with GTK+?  I know
->that only one process should expect to do anything GUI related (right?),
	Yes (at least in the threaded env, but it should be the same in
	a multiproccess env).

->but does the same hold true for GLIB stuff (g_print, etc)?  What are the
->Do's and Don't's on this?  
	
	Since glib does not handle the gui, you may uses glib stuff in
	every child processes. This is not a problem.

->Also, the child should exit with _exit() rather
->than exit(), correct?

	Exit() just works until you don't register atexit function
	that free() something wrong (and so on). Basically, exit()
	calls all atexit registered functions, flushes streams, closes
	opened streams, destroy temp files than calls _exit(), which
	close opened FDs, send SIGCHLD to its parent (if one exists),
	do some tricky stuff to have its sons be the init daemon sons,
	and send SIGHUP and SIGCONT to others.

->
->Dan "getting dangerously close to a working darts game"
-> ____    Kressin   ____   .-----------------------------------. 
->/___ \____________/ __ \  | dkressin@acm.org                  |
->    \  \    /      /  \ | | Lead Programmer/Analyst           |
-> ___/ __\/\/rench_ \__/ | | University of Wisconsin - Oshkosh |
->\____/            \____/  | www.mio.uwosh.edu/~kressd11/      |
->                          `-----------------------------------'
->
->-- 
->To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
->


-- 
__________________________________________________________________________
   Emmanuel DELOGET [pixel] pixel@{dotcom.fr,epita.fr}  ----  DotCom SA
         http://www.epita.fr/~pixel | http://www.dotcom.fr/~pixel
"On the last day, God created Linux. And Microsoft won its antitrust case"
--------------------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]