>>>>> "BT" == Ben Tilly <[email protected]> writes:

  BT> There are a couple of options available.  The simplest being to set
  BT> the PERL_SIGNALS environment variable to "unsafe".  However that is
  BT> unsafe, and you can dump core.  I've generally gone with that approach
  BT> anyways, though, because I've wanted to do things like force a
  BT> database connection to Oracle to timeout.

  BT> Other options include trying to use the :perlio layer (with the
  BT> default configuration it is the default, but you may have a Perl
  BT> compiled without it) or to carefully use unbuffered I/O so that you're
  BT> never blocked in an uninterruptable op-code.

other options include running the subprocess under some ipc which isn't
blocking and poll for its exit (nonblocking wait or sigchld) every n
seconds. or run an event loop again, handling sigchld or a close on a
handle to detect if the process exits normally. timing that out is easy
then - just sigkill the subprocess when a timer (event loops have
timers) triggers or your poll timing exceeds the max time.

event loops handle signals safely so you don't need to deal with perl's
newer safe signal handling issue. 

uri

-- 
Uri Guttman  ------  [email protected]  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to