in reply to Why isn't this code thread-safe? (Is "require" thread-safe??)
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why isn't this code thread-safe? (MCE!)
by vr (Curate) on Nov 10, 2018 at 11:41 UTC | |
by BrowserUk (Patriarch) on Nov 10, 2018 at 13:18 UTC | |
by marioroy (Prior) on Nov 19, 2018 at 22:06 UTC | |
by marioroy (Prior) on Nov 19, 2018 at 22:25 UTC | |
by vr (Curate) on Nov 20, 2018 at 16:48 UTC |