Thread

Posted on Fri Apr 25 17:31:29 2008 by yantisj
Net::Appliance::Session with Threads
Oliver, I am trying to accomplish the same thing with threads as Miky moving from Net::Telnet::Cisco. I can fall back to fork() if I have to, but somehow Net::Telnet::Cisco avoids this issue with threads. I have run in to a signaling issue on timeouts connecting to a host using Net::Telnet that will kill off my threads, so likely it is not fully thread-safe. It was related to $SIG{ALRM}. Perhaps your method for timeout on prompt is running in to a similar issue. I have to say I'm no expert on this, but somehow Net::Telnet::Cisco avoids the issue with threads. Other than that it looks like a great library that I can use in other areas that don't require parallel jobs. Thanks
Direct Responses: 7802 | Write a response
Posted on Thu May 1 21:55:25 2008 by oliver in response to 7766
Re: Net::Appliance::Session with Threads
Hi, cpanforum@cpanforum.com wrote: | I have run in to a signaling issue on timeouts connecting to a host | using Net::Telnet that will kill off my threads, so likely it is not | fully thread-safe. It was related to $SIG{ALRM}. Perhaps your | method for timeout on prompt is running in to a similar issue. In my module, Net::Appliance::Session, there is no alarm or timeout handling code. This module is a wrapper around Net::Telnet, and uses it for all alarm and timeout functions. Therefore, as you say, it's likely that Net::Telnet is not fully thread safe. In that case, there is not a lot I can do, except suggest you ask the author of Net::Telnet. | I can fall back to fork() if I have | to, but somehow Net::Telnet::Cisco avoids this issue with threads. If you can provide a code example (test case) where something fails under Net::Appliance::Session (in Telnet Transport mode) but succeeds under Net::Telnet::Cisco, then it would be very useful and I might be able to find out if Net::Telnet::Cisco is in fact working around this problem in Net::Telnet, as you suggest. regards, oliver.
Write a response