Re: [gtk-list] fork & gtk-perk = nono



On Sun, Sep 06, 1998 at 05:27:09PM -0400, Kenneth Albanowski wrote:
> I'm forwarding this to the list for Marc Lehmann. He's noted that forking
> from within Gtk/Perl does not work very well. I'm not enough of an expert
> in X to know for sure whether this is a fundamental X glitch, a Gtk
> limitation, or just a bug.

There is the same problem in C as it is X related (open file handles sharing).
If you fork you need to either exec*() or _exit() (note the underline).
We could add a Gtk->_exit() function that calls _exit() but
using something like _exit() in perl is not a good idea, I think.
A way to solve the problem without changes to perl and the Gtk module
is to use something like this as you pointed out:

use Gtk;

fork || do { 
	do_stuff; 
	exec('true')
};

sleep 1;
Gtk->exit(0);

lupus

-- 
"The number of UNIX installations has grown to 10, with more expected."
    - _The UNIX Programmer's Manual_, Second Edition, June, 1972.



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