PDA

View Full Version : سوال: مفهوم این Error چیست؟



ebrahimashori
چهارشنبه 07 دی 1390, 19:04 عصر
برنامه من برو روی یک فایل متنی پردازش می کنه. یعنی مقادیری حرف و عدد در هر لحظه در چند فایل متنی ذخیره یا حذف می شوند. پس از گذشت چند ثانیه با یک Error مواجه میشم.متن کاملش رو در زیر و عکسش رو در ضمیمه قرار می دهم.می خواستم بدنم معنی یا مفهومش این Error چیه؟

file:///C:/DOCUME%7E1/ebrahim/LOCALS%7E1/Temp/moz-screenshot.pngThe CLR has been unable to transition from COM context 0x2045e8 to COM context 0x204758 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.

haniyehghassami
چهارشنبه 07 دی 1390, 21:06 عصر
برنامه من برو روی یک فایل متنی پردازش می کنه. یعنی مقادیری حرف و عدد در هر لحظه در چند فایل متنی ذخیره یا حذف می شوند. پس از گذشت چند ثانیه با یک Error مواجه میشم.متن کاملش رو در زیر و عکسش رو در ضمیمه قرار می دهم.می خواستم بدنم معنی یا مفهومش این Error چیه؟

file:///C:/DOCUME%7E1/ebrahim/LOCALS%7E1/Temp/moz-screenshot.pngThe CLR has been unable to transition from COM context 0x2045e8 to COM context 0x204758 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.


The main thread of your program has been busy executing code for a minute. It is not taking care of its normal duties, pumping the message loop. That's illegal when you use COM servers in a worker thread, calls to their methods cannot be dispatched until your main thread goes idle again.

It should be readily visible, your UI should be dead as a door nail. Windows should have replaced your main window with a ghost that displays "Not Responding". Closing the window won't work, no click events have any effect.

What ever your main thread is doing should be done by a worker thread instead. The BackgroundWorker class is good for that, you'll find many usage help in the MSDN Library article for it. Use Debug + Break All, Debug + Windows + Threads if you have no idea what the main thread is doing.

One more possible cause, be sure to install service pack 1 if you are using the RTM version of VS2005

سلام ؛ یه نگاهی به این (http://stackoverflow.com/questions/2797677/contextswitchdeadlock-was-detected-error-in-c-sharp) بندازین

اینجا یکی دیگه هم گفته می خواستین سوییچ کنین تو تردتون که ترد هدف بیزی بوده
کلا این ارور ناشی از مولتی تردینگ ها هست که ترد هاتون درست کنترل نشدند (البته این نظر منه و نمیدونم درست باشه یا خطا)