Now please allow me some follow-ups.
First, regarding the creation of $hoh. I tried replacing your
withmy $hoh = { A => shared_clone( { NAME => 'aa' } ), B => shared_clone( { NAME => 'bb' } ), };
Why doesn't this work? doesn't 'shared_clone' does deep sharing?my $hoh = { A => { NAME => 'aa' }, B => { NAME => 'bb' }, }; $hoh = shared_clone($hoh);
This is not just a hypothetical question. I get my $hoh unshared (I might even retrieve it), that is, I do not create it at the same time I call this piece of code. So how can I take an unshared $hoh and use it here?
Second, if I understand correctly, you start a thread for each element of hoh. There are usually a few hundreds elements there, so I guess it's not as good idea. That's why I originally wanted yo use a thread pool, until you advised me otherwise.
Thanks again.
In reply to Re^4: Multi-threads newbie questions
by daverave
in thread Multi-threads newbie questions
by daverave
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |