in reply to threads and SNMP Session

The following info may help diagnose things:

  1. Perl version (all 3 digits)
  2. O/S and platform information

Also, have you tested that everything works when you *don't* use threads, i.e., the first host gets dumped out, then the 2nd ?

Replies are listed 'Best First'.
Re^2: threads and SNMP Session
by Otogi (Beadle) on Dec 19, 2005 at 23:11 UTC
    Perl version is 5.8.5 Platform: Gentoo linux Yes, it does work if i dont use threads. It also works if I add  sleep 1; to the subroutine test before printing the info. Hope this helps!
      I didn't see a join() anywhere in your app (which may explain your ability to get a result w/ sleep 1). After you spawn your threads, you need to explicitly wait for them all to complete via:
      $thr->join(); $thr2->join(); ...etc...
      Otherwise the main thread will just exit, which may cause the child threads to get prematurely killed.