- Posts: 43
- Thank you received: 0
Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- General Issues, Building
- Threading Error (calling dispose from a background thread)
Threading Error (calling dispose from a background thread)
Thanks for your assistance.
Please Log in or Create an account to join the conversation.
The one thing I have *not* done yet is to make the original project run on my machine (it seemed too complicated, given that I need to attach the database, change the tag names etc.). Do you think it is now the moment to make this effort?
Note: I will be mostly unavailable till Tuesday.
Please Log in or Create an account to join the conversation.
I am not attempting to dispose of the object manually. I guess this means it should stay alive until it is garbage collected.
Please Log in or Create an account to join the conversation.
I have a question.
When you say
It appears that when the application tries to destroy an EasyDAClient object in a background thread
are you talking about a specific, explicit call to EasyDAClient.Dispose()? Because, I cannot find it in the app... . Can you point me to the file and method/line where it is done, or (even better) provide a call stack that leads to the Dispose()? Or, are we instead of some kind of system-induced call - when and how?
Thank you
Please Log in or Create an account to join the conversation.
I currently have a workaround for this problem. Analysis of the event log revealed that just prior to the crash of the application, an OutOfMemoryException would be thrown in the constructor of the SanritsuDownload class. I converted the class into a singleton class and used a ConcurrentQueue to feed download requests, which then would actually be performed in a long-running BackgroundWorker.
I can't see inside the EasyDAClient code, but I suspect that it has a problem releasing resources when the application is done with it. Either that, or I'm doing something incorrectly with respect to managing the object
Please Log in or Create an account to join the conversation.
Can you send me the project, so that I can reproduce it easily?
Please Log in or Create an account to join the conversation.
It appears that when the application tries to destroy an EasyDAClient object in a background thread, we get the exception shown here:
<Exception><ExceptionType>System.Threading.ThreadStateException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Thread has not been started.</Message><StackTrace> at System.Threading.Thread.JoinInternal(Int32 millisecondsTimeout)
at System.Threading.Thread.Join()
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerPump.stop(CDAInnerPump* )
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerPump.{dtor}(CDAInnerPump* )
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerPump.__vecDelDtor(CDAInnerPump* , UInt32 A_0)
at OpcLabs.EasyOpcRaw.DataAccess.FreeObject(CObject*&amp; pObject)
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient.!RawEasyDAClient()
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient.Dispose(Boolean A_0)
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient.Finalize()</StackTrace><ExceptionString>System.Threading.ThreadStateException: Thread has not been started.
at System.Threading.Thread.JoinInternal(Int32 millisecondsTimeout)
at System.Threading.Thread.Join()
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerPump.stop(CDAInnerPump* )
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerPump.{dtor}(CDAInnerPump* )
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerPump.__vecDelDtor(CDAInnerPump* , UInt32 A_0)
at OpcLabs.EasyOpcRaw.DataAccess.FreeObject(CObject*&amp; pObject)
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient.!RawEasyDAClient()
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient.Dispose(Boolean A_0)
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient.Finalize()</ExceptionString></Exception>
Is there something that I am doing to cause this issue? It looks like maybe the client is trying to access a thread that is in the "Unstarted" state?
How should I be handling the disposal of these objects (if at all)? From reading, it looks like I should call Dispose before exiting as opposed to waiting for the garbage collector?
Thanks for your help.
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- General Issues, Building
- Threading Error (calling dispose from a background thread)