N
nicolas.hilaire
Hi all,
i'm doing a quite long treatment in a function, and i'm showing the
progress of the treatment with a progressbar. The code is something
like this :
for each(entry in entries) // about 100 entries
{
TreatmentForOneOr2Secs();
this->progressBar1->PerformStep();
}
during the debug, the debugger tells me that :
Managed Debugging Assistant 'ContextSwitchDeadlock' has detected a
problem in 'd:\test\NetSendDotNet\debug\NetSendDotNet.exe'.
Additional Information: The CLR has been unable to transition from COM
context 0x189558 to COM context 0x189408 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.
Specially :
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, how can i pumping messages ? or, should i use a thread (and how ?)
Thanks for your help
Nicolas H.
i'm doing a quite long treatment in a function, and i'm showing the
progress of the treatment with a progressbar. The code is something
like this :
for each(entry in entries) // about 100 entries
{
TreatmentForOneOr2Secs();
this->progressBar1->PerformStep();
}
during the debug, the debugger tells me that :
Managed Debugging Assistant 'ContextSwitchDeadlock' has detected a
problem in 'd:\test\NetSendDotNet\debug\NetSendDotNet.exe'.
Additional Information: The CLR has been unable to transition from COM
context 0x189558 to COM context 0x189408 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.
Specially :
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, how can i pumping messages ? or, should i use a thread (and how ?)
Thanks for your help
Nicolas H.