A couple of thoughts on this.
One of the drawbacks of threads, is that if a thread calls "exit".... it will take down the entire process, all other threads will exit too. I think you mean detach instead of exit.
Secondly, when a thread updates a shared hash, none of the other threads see the update, until they actually try to read it themselves. This is why I like timers so much in the main thread. It can repeatedly loop thru share hashes and update the shared values. As far as I know, there is no tie in shared hashes, that would be a neat feature.
One of the often overlooked aspects of threads, is that in order for a thread to be joined OR detach and dissappear, is that the thread must either
1. reach the end of it's code block or
2. return
So you need to design your threads to finish properly, or they may never join or detach successfully..... they may hang around and give an error like " program exited with 3 threads still running"
In reply to Re^10: Should I use threads? Perl/DHCP/Radius
by zentara
in thread Should I use threads? Perl/DHCP/Radius
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |