I'm spawning a number of worker threads via Thread::Pool:: Simple. I want to have each of them connect to a database in &init() or &pre() and commit their changes in &post(). I don't see how to create a thread local variable using Thread::Pool::Simple.
The best solution I've come up with so far is to create a shared hash, the place the database handle into the hash --with the thread ID as the key--in pre, and delete it in post, after committing the changes.
Is there a better way?
In reply to Thread local variables in Thread::Pool::Simple by Annirak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |