EDN Admin
Well-known member
ERROR:
ContextSwitchDeadlock was detected<br/>
Message: The CLR has been unable to transition from COM context 0x225af0 to COM context 0x225c60 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation
without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment
(STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
So, the question is ... H ow I can I update the VB6 form which calls the C# class?
(Aside from re-writing the VB6 form ... that is not an immediate option, and through migration of millions of lines of code, it would be helpful to know the best way to go about doing this.)
The VB6 form is in a .NET project, which is dependent on the project which holds the C# class (obviously a C# class library project).
Any helpful ideas from experienced devs?
I have two initial thoughts:
1.) Update the thread indirectly (an inaccuratly) by passing it into another function as a variable updated by the C# libraries through each iteration of its process, and a VB6 timer to check that instantiated function?
2.) Have the VB6 form arbitrarily tick until receiving a return value, or the instianted thread is terminated ... (again, problematic if it breaks ... no notice).
A few other ideas, but Id like to hear from anyone who might have some code or ideas to look into.
View the full article
ContextSwitchDeadlock was detected<br/>
Message: The CLR has been unable to transition from COM context 0x225af0 to COM context 0x225c60 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation
without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment
(STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
So, the question is ... H ow I can I update the VB6 form which calls the C# class?
(Aside from re-writing the VB6 form ... that is not an immediate option, and through migration of millions of lines of code, it would be helpful to know the best way to go about doing this.)
The VB6 form is in a .NET project, which is dependent on the project which holds the C# class (obviously a C# class library project).
Any helpful ideas from experienced devs?
I have two initial thoughts:
1.) Update the thread indirectly (an inaccuratly) by passing it into another function as a variable updated by the C# libraries through each iteration of its process, and a VB6 timer to check that instantiated function?
2.) Have the VB6 form arbitrarily tick until receiving a return value, or the instianted thread is terminated ... (again, problematic if it breaks ... no notice).
A few other ideas, but Id like to hear from anyone who might have some code or ideas to look into.
View the full article