in reply to Re^2: perl threads crashed
in thread perl threads crashed
Update: If SIGPIPE happens in send_message(), it won't be handled until after handler finishes. I don't see a big deal with that as since you don't have a handler installed for SIGPIPE, you are going to die anyway. I would consider connecting to the DB before the while(1)..leave connection open if you are going to use it every 10 seconds, ditto for the other socket.#!/usr/bin/perl -w use strict; $SIG{USR1} = \&handler; $SIG{ALRM} = \&handler; while (1){alarm 5; sleep 100;} sub handler { print "Do work \n"; #your get_message,send_message calls }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: perl threads crashed
by liunx (Initiate) on Jun 09, 2011 at 01:21 UTC | |
by Marshall (Canon) on Jun 09, 2011 at 02:13 UTC |