ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Are the ielib DLLs threadsafe?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

am24

30 Posts

Posted - May 01 2014 :  05:18:20  Show Profile  Reply
When I try to load RAW files in the main thread and in a background thread by using the ielib32/64 DLLs, my application starts to hang. When I use the dcrawlib.dll everything works fine.

Without the dcrawlib, it also works when I protect loadfromfile operations with a critical section.

Here's a trace report to see where it hangs without dcraw or my own critical sections (Using version 5.1.0 and Delphi XE5):

main thread ($1898):
776eefe8 +000 ntdll.dll RtlEnterCriticalSection
0827af92 +052 ielib32.dll ?createDCRAWDecoder@IELib@ievisionexp@@UAGJAAVStream@2@AAVVectorString@2@PBX2HAAPAVDCRAWDecoder@2@@Z
0040c129 +009 project1.exe System 35447 +6 @IntfCopy
00895c6b +663 project1.exe ieraw 6290 +116 IEReadCameraRAWStream
008bd404 +0b8 project1.exe imageenio 25549 +14 TImageEnIO.SyncLoadFromStreamRAW
008bd5a3 +077 project1.exe imageenio 25624 +11 TImageEnIO.LoadFromFileRAW
0089dcde +3ee project1.exe imageenio 10959 +102 TImageEnIO.LoadFromFile

xequte

38947 Posts

Posted - Mar 31 2016 :  03:47:25  Show Profile  Reply
Hi

IELib should be thread safe.

Can you email us a small project that reproduces the issue?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Mar 31 2016 :  07:28:03  Show Profile  Reply
Hi am24

I created an example of ' Thread Safe ' which uses a single Instance of TImageEnView Using a Pointer and Protection block

Works Very Fast.

Watch the Video and study the Source Code.

A Good Luck.

Movie Here
attach/wesleybobato/201633172642_Movie.zip
5194.73 KB

Source Code Here
attach/wesleybobato/201633172754_ThreadSafe.zip
86.37 KB
Go to Top of Page

am24

30 Posts

Posted - Mar 31 2016 :  07:37:33  Show Profile  Reply
OK, my initial question is already 2 years old before it was answered, so many things happened in the meantime ;)

The crash was caused by an ImageEn helper function, but I cannot remember which one. As I could fix this myself, it runs in a thread without any problem since then.
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Mar 31 2016 :  08:27:51  Show Profile  Reply
Hi

Please Post Your Code.
Go to Top of Page

am24

30 Posts

Posted - Mar 31 2016 :  08:43:58  Show Profile  Reply
As this is part of a commercial product I'm not able to post any code, sorry.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 31 2016 :  08:47:52  Show Profile  Reply
Writing threads is not for the faint of heart, so without code I doubt anyone can help you. You could recreate the part of the code where you are having problems in a small demo.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Mar 31 2016 :  09:08:04  Show Profile  Reply
Hi

Build your project in DEBUG mode or Install EurekaLog

Renders your routine To Cause the error.

Use PrintScreen error Only.

and shares in order to be able to help you.
Go to Top of Page

am24

30 Posts

Posted - Mar 31 2016 :  09:08:30  Show Profile  Reply
@w2m: Seems that you have missed my post #4 in that thread, here it is again:

 
OK, my initial question is already 2 years old before it was answered, so many things happened in the meantime ;)

The crash was caused by an ImageEn helper function, but I cannot remember which one. As I could fix this myself, it runs in a thread without any problem since then.


I don't have a problem with threads and everything runs perfectly well since ~2 years.
Go to Top of Page

xequte

38947 Posts

Posted - Mar 31 2016 :  13:19:58  Show Profile  Reply
Hi

Yes, sorry. I don't know how we missed your message the first time, but a customer brought it to my attention.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: