Locking a Thread::Queue shouldn't be needed, that's what the module does for you.
If you need the dictionary to be fast, there's no other option than to share it or duplicate it. If it could be slow, you can create another worker with its own queues that would update the dictionary and answer queries about its content. Basically, when you use Thread::Queue, you shouldn't need threads::shared at all.
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
In reply to Re: ithreads, locks, shared data: is that OK?
by choroba
in thread ithreads, locks, shared data: is that OK?
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |