Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
App with more 2 or more threads with Tesseract will deadlock on Linux (but not on OSX). #2312
We have a
If we run this code in a Docker container locally on a MacBook Pro or ECS or a VM in EC2 with 16 cores the application will deadlock with the tesseract code enabled.
NOTE: What is interesting is that running the same code straight up on a MacBook Pro does not deadlock the code.
Multi-threaded application can work.
I built tesseract with
Thanks for the RTFM answer, very helpful.
In this case it's not about increasing the speed of OCR as such, I've got way more going on when I am analyzing the video frame and I was hoping I could have each frame analyzed in its own thread such that the process would be self contained and I could scale this up if I need to analyze more frames per second.
Furthermore allowing Tesseract to run in each thread would also prevent me from having to build a solution that will consolidate the data for each frame from multiple sources.
I am afraid that there is a potential misunderstanding.
Applications which use the Tesseract library can do the same, but in addition they can use more than one thread to process several pages in parallel. @Sauraus, I have understood that you tried to do this and got a deadlock. Am I right? Then this is a bug which should be fixed. It would help to use a Tesseract library with debug information, attach a debugger to the locked process and get stack traces for all threads to see where they are hanging.
@stweil you are correct in your description of the behaviour observed when using Tesseract as a lib.
However the problem also appears to have resolved itself as we are no longer seeing deadlocks, however I cannot say with certainty what