Just another Perl shrine | |
PerlMonks |
Re^2: having a container on perl VMs is good ?by Corion (Patriarch) |
on Nov 12, 2022 at 06:45 UTC ( [id://11148156]=note: print w/replies, xml ) | Need Help?? |
Not to detract from your points, threads::shared has synchronization primitives and also ensures that a shared variable is written to by only one thread at a time. But IMO when you start using / needing these, something went wrong in the overall design already. I prefer to structure my thread code around Thread::Queue, which changes the design to something message-based and which is far easier to reason about than variables that get updated by multiple threads.
In Section
Seekers of Perl Wisdom
|
|