LEADTOOLS Support
General
General Questions
Intermittent Initialization problem - possibly a threading issue
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Friday, August 1, 2008 6:12:44 AM(UTC)
Groups: Registered
Posts: 3
Guys,
The file version of LeadTools we're using is 15,0,0,31.
Code written in VB.Net for VS2005
Our software takes incoming files, performs some checks and shuffels them into different destinations.
Incoming tifs are checked for undue stretching and corrected. We use LeadTools to do this.
We have several worker threads each picking up a file and processing it.
RasterCodecs.Startup() is called on the main thread. RasterCodecs.Load is called on a worker thread.
Mostly everthing works well, except occasionally (and on one cleint site in particular) the call to RasterCodecs.Load fails with "Leadtools.RasterException: File not found" - trust me, the file is there.
I have a very simple test harness that will sometimes work, sometimes not.
My question is, should RasterCodecs.Startup() be called for each thread? If so, do we need an exact match between calls to StartUp() and Shutdown().
Is this a "now you see it, now you don't" because of the underlying windows threading model. If so, and assuming we should call Startup() for each thread, do we need to ensure they've been called for the underlying thread, or is it sufficient to look after .net threading only.
Any help with this would be appreciated.
Thanks,
P.S. This "appears" to go away when Startup() is called for each thread, but because it's intermittent and I don't know what caused the original problem, I don't trust it as a solution.
#2
Posted
:
Sunday, August 3, 2008 5:39:45 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
First, you are using an old build of LEADTOOLS DLLs. I suggest that you send your LEADTOOLS serial number to a new email to
support@leadtools.com and mention this post.
About the problem itself, I can try to get a complete answer if you send me your small test harness (not your full application) in a ZIP or RAR file. You can either post it here or send it with the support email message.
#3
Posted
:
Monday, August 4, 2008 11:28:31 PM(UTC)
Groups: Registered
Posts: 3
Thanks, very much.
Here is the Sample application
#4
Posted
:
Tuesday, August 5, 2008 4:02:06 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I tested your project using the latest LEADTOOLS v15 DLLs from the latest patches, and I did not see the problem. Is there any special steps I need to follow to see the problem? Can you test your project at your side with the latest DLLs and see if the problem is still active?
#5
Posted
:
Tuesday, August 5, 2008 6:39:33 AM(UTC)
Groups: Registered
Posts: 3
Hi. Can I ask are there any thread specific data initialised by RasterCodecs.Startup?
If the answer is no we can stop investigating threading and look at other environmental factors.
Thanks,
#6
Posted
:
Wednesday, August 6, 2008 6:09:30 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
RasterCodecs.Startup() initializes threading settings for the current thread. So if you have a multiple threaded application, and you want to use RasterCodecs inside the thread procedure, you need to call RasterCodecs.Startup and create a new instance of RasterCodecs inside that procedure.
#7
Posted
:
Sunday, August 10, 2008 9:56:50 PM(UTC)
Groups: Registered
Posts: 28
You might want to update your doc's on this since they state: "This static (shared) method must be called before using other members of the
Codecs namespace. This usually occurs at the start of your application." (http://www.leadtools.com/Help/LEADTOOLS/v15/DH/CO/Leadtools.Codecs~Leadtools.Codecs.RasterCodecs~Startup.html), which is a little vague in my opinion since if the call initializes thread specific data then it must be called on each thread that wishes to use the raster codecs class.
#8
Posted
:
Monday, August 11, 2008 8:11:56 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I will update our .NET documentation about this.
LEADTOOLS Support
General
General Questions
Intermittent Initialization problem - possibly a threading issue
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.