-
-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pdfium is not thread safe #1275
Comments
Hello, libvips puts a lock around PDFium calls so it'll never try to process the same document with more than one thread. This seems to work, in the limited testing I've done. From your links it looks like we might need to prevent parallel access to different docs as well. Unfortunately the PDFium build system has changed enough since we added PDFium load to break everything :( It'll need a few days work to get it functioning again. |
Thank you very much for the swift reply, I was looking for a mutex lock or something but didn't find it (I guess I was looking in the wrong place). We're calling PDFium from Go, and I wondered if it was possible to reduce lock contention without going to multi process. |
The lock is in the That binary PDFium distribution looks interesting. The last time I looked at PDFium itself, they'd broken library builds completely -- I guess they were concentrating on building as a component of chrome. Hopefully that's fixed now. |
We used to lock within documents, ie. we did not allow two threads to work on the same file. However pdfium is not threadsafe in any way, and this is not supported, see: https://groups.google.com/forum/#!msg/pdfium/kyIdh_J4csg/K1LvfPiHDwAJ This patch adds locks around pdfium calls. see: #1380 #1275
How do you get around the lack of thread safety in Pdfium, combined with the general promise that libvips is thread safe?
Pdfium's mailing lists are quite clear that they are not thread safe;
https://groups.google.com/forum/#!msg/pdfium/kyIdh_J4csg/K1LvfPiHDwAJ
https://groups.google.com/forum/#!topic/pdfium/HeZSsM_KEUk
The text was updated successfully, but these errors were encountered: