in reply to ithreads, locks, shared data: is that OK?
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,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ithreads, locks, shared data: is that OK?
by bliako (Abbot) on Sep 20, 2018 at 09:35 UTC | |
by choroba (Cardinal) on Sep 20, 2018 at 09:38 UTC | |
by bliako (Abbot) on Sep 20, 2018 at 10:08 UTC | |
by choroba (Cardinal) on Sep 20, 2018 at 12:29 UTC | |
by bliako (Abbot) on Sep 20, 2018 at 15:57 UTC | |
|