Thread-safety is not yet available, but will probably be available in a
future release.
The 3.00 api moves towards this by making it based on an instance of the api
instead of static methods. It is nearly possible to use two different apis
alternately in the same thread, but using them concurrently in separate
threads is still a long way off. There are still some critical global
variables to change, and the memory manager has to be protected by a mutex,
or made thread-local. Either of these changes would be fraught with
portability issues. I haven't really thought about this aspect deeply enough
to come up with a good solution, but it would be nice for the memory manager
to be local to CCUtil, so all its memory can be freed on destruction of the
API object. That would be much harder to do than just protecting it with a
mutex however
If you want to have a go at making the changes, please do, but do it to
3.00, so there is more chance of merging the changes with the mainline code.
:)
Thanks,
Ray.

On Wed, Aug 19, 2009 at 9:10 AM, Remi Thomas <remi.tho...@gmail.com> wrote:

>
> Wrong thread + .NET question
> Do you expect an answer?
>
> On Aug 19, 2:06 pm, Mariusz Matula <matula.mari...@gmail.com> wrote:
> > found bug in DLL ?
> > who can say me what is wrong here:
> > with sleep works without sleep DOES NOT WORK
> > for (int i = 0; i < sectionPoints.Count;i=i+2)
> >   {
> >   subImage = new Bitmap("subImage{"+i+"}.jpg");
> >   subImage.SetResolution(96, 96);
> >   progressBar1.Value = 0;
> >
> >   tessnet2.Tesseract ocr = new tessnet2.Tesseract();
> >   if (sectionPoints[i].isDigit)
> ocr.SetVariable("tessedit_char_whitelist",
> > "0123456789"); // if digits only
> >   ocr.Init(dictionaryPath, countryType, false);
> >   ocr.ProgressEvent += new
> > tessnet2.Tesseract.ProgressHandler(ocr_ProgressEvent);
> >   ocr.OcrDone = new tessnet2.Tesseract.OcrDoneHandler(Done);
> >   ocr.DoOCR(subImage, Rectangle.Empty);
> >   this.panel1.Refresh();
> >   Thread.Sleep(1000); //
> >  -------------------------------------------------------
> >   }
> > ???????????????????????????
> >
> > 2009/8/19 Ab <abhijit.dive...@gmail.com>
> >
> >
> >
> > > Hi Remi,
> >
> > > Thanks for your reply. Is it relatively not that complicated if I
> > > wanted to make the required changes to make the code support multiple
> > > threads - handle the globals and static variables appropriately maybe?
> >
> > > Abhijit
> >
> > > On Aug 19, 1:50 pm, Remi  Thomas <remi.tho...@gmail.com> wrote:
> > > > Hi,
> >
> > > > No, because of global variables in OCR process.
> >
> > > > Remi
> >
> > > > On Aug 19, 10:35 am, Ab <abhijit.dive...@gmail.com> wrote:
> >
> > > > > Just FYI: I am using v 2.03
> >
> > > > > On Aug 19, 12:03 pm, Ab <abhijit.dive...@gmail.com> wrote:
> >
> > > > > > Hi,
> >
> > > > > > I am using Tesseract in a multi threaded mode (in C++, Windows)
> i.e.
> > > > > > multiple threads will be doing OCR of different images
> concurrently.
> > > > > > I've based my code off the tesseract.exe project.
> >
> > > > > > Does Tesseract support multi threads?
> >
> > > > > > Thanks,
> > > > > > Ab
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To post to this group, send email to tesseract-ocr@googlegroups.com
To unsubscribe from this group, send email to 
tesseract-ocr+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/tesseract-ocr?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to