Hello all,
Recently I have a need to create threads which when running certain calls, tend to die() somewhere. As you know, it is quite difficult to find a dead thread. The only thing is to try and keep the thread alive under all circumstances!
I think the easiest way is to trap the thread running routine with the eval(), or more commonly known as exceptions by other languages. For me, I will do the following code:
sub run
{
while (1)
{
try
{
# bunch of statements here
}
catch MyException with
{
#log the error, or do anything you want when you know the statements screwed up
};
}
}
Just to share a thought. _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
