c# - DisconnectedContext/ContextSwitchDeadlock was detected -


i have richtextbox heavy message logging multi threads. after time first received "disconnectedcontext detected" message , removed breaking on exception debug->exceptions... window. received "contextswitchdeadlock detected". removed , ui came life. after time freezed again.

is there way prevent this? or there component supports coloring, changing fonts give visual feedback in .net richtextbox without error?

contextswitchdeadlock detected
message: clr has been unable transition com context 0x6eb0760 com context 0x6eb08d0 60 seconds. thread owns destination context/apartment either doing non pumping wait or processing long running operation without pumping windows messages. situation has negative performance impact , may lead application becoming non responsive or memory usage accumulating continually on time. avoid problem, single threaded apartment (sta) threads should use pumping wait primitives (such cowaitformultiplehandles) , routinely pump messages during long running operations.

are sure updating richtextbox multiple threads? if you'd better stop , use ui thread update rtb. that: call theform.begininvoke( delegate method updates rtb)

this should allow concurrent threads continue asap without waiting response.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -