laziness, impatience, and hubris | |
PerlMonks |
Re: Why isn't this code thread-safe? (MCE!)by BrowserUk (Patriarch) |
on Nov 10, 2018 at 08:09 UTC ( [id://1225516]=note: print w/replies, xml ) | Need Help?? |
The problem is almost certainly that CAM::PDF or one of its many dependencies isn't thread safe. I vaguely recall finding that one of the GZIP modules used some global state internally at the C/XS level. There are ways around it (using threads), but they require knowledge and testing I'm no longer in a position to supply, but in any case there is a better way for this type of application: marioroy's MCE. He has posted dozens of well written and tested examples of exactly this type of IO multi-tasking problem, and has proven himself willing and able to actively support those using his code. And finally, even my best attempts at IO multitasking using threads never came close to achieving the same level of throughput and performance that he achieved with his early versions; and his latest stuff is even more efficient. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.
Suck that fhit
In Section
Seekers of Perl Wisdom
|
|