473,769 Members | 6,286 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ContextSwitchDe adlock Problem



Hi,

As iam working on convertion of C#1.1 to 2.0. Iam facing a problem
(screen is flickered) while opening and closing any artifacts. When i
tried to debug it is througing ContextSwitchDe adlock MDA exception i.e.

The CLR has been unable to transition from COM context 0x1a0768 to COM
context 0x1a08d8 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 CoWaitForMultip leHandles) and routinely pump messages during
long running operations.

please suggest...

*** Sent via Developersdex http://www.developersdex.com ***
Feb 13 '07 #1
7 8113
Could be a false positive because of debugger.
Check if this applies:
http://blogs.msdn.com/jmstall/archiv...hDeadLock.aspx

"Kalpana" <ka*****@devdex .comha scritto nel messaggio
news:eS******** ******@TK2MSFTN GP04.phx.gbl...
>

Hi,

As iam working on convertion of C#1.1 to 2.0. Iam facing a problem
(screen is flickered) while opening and closing any artifacts. When i
tried to debug it is througing ContextSwitchDe adlock MDA exception i.e.

The CLR has been unable to transition from COM context 0x1a0768 to COM
context 0x1a08d8 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 CoWaitForMultip leHandles) and routinely pump messages during
long running operations.

please suggest...

*** Sent via Developersdex http://www.developersdex.com ***

Feb 13 '07 #2

It is not working.
Is there is any chance of having this problem due to the handles invoked
from WndProc()?

Previoulsy i had a problem with Utilitylibrary. Rebar --WndProc()
recursive call (deadlock). I posted this problem but no one reply --so
for the temporary survive i kept a condition for termination (to avoid
deadlock). condition is:
if (m.Msg == (int)Msg.WM_WIN DOWPOSCHANGED)
return;
if condition reaches then control will be returned from WndProc().

Is this present problem of flickering (when we don't debug) and
ContextSwitchDe adLock exception --(when we debug -- see the exception
below) is due to WndProc() condition??
However please suggest

EXCEPTION DESCRIPTION:
The CLR has been unable to transition from COM context 0x1a0768 to COM
context 0x1a08d8 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 CoWaitForMultip leHandles) and routinely pump messages during
long running operations.

*** Sent via Developersdex http://www.developersdex.com ***
Feb 13 '07 #3
WndProc should be considered as non re-entrant (and this not recursive).
If you must send messages to other controls owned by you, use PostMessage
(non blocking), not SendMessage (blocking).

"Kalpana" <ka*****@devdex .comha scritto nel messaggio
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>
It is not working.
Is there is any chance of having this problem due to the handles invoked
from WndProc()?

Previoulsy i had a problem with Utilitylibrary. Rebar --WndProc()
recursive call (deadlock). I posted this problem but no one reply --so
for the temporary survive i kept a condition for termination (to avoid
deadlock). condition is:
if (m.Msg == (int)Msg.WM_WIN DOWPOSCHANGED)
return;
if condition reaches then control will be returned from WndProc().

Is this present problem of flickering (when we don't debug) and
ContextSwitchDe adLock exception --(when we debug -- see the exception
below) is due to WndProc() condition??
However please suggest

EXCEPTION DESCRIPTION:
The CLR has been unable to transition from COM context 0x1a0768 to COM
context 0x1a08d8 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 CoWaitForMultip leHandles) and routinely pump messages during
long running operations.

*** Sent via Developersdex http://www.developersdex.com ***

Feb 13 '07 #4
"Kalpana" <ka*****@devdex .comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>
It is not working.
Is there is any chance of having this problem due to the handles invoked
from WndProc()?

Previoulsy i had a problem with Utilitylibrary. Rebar --WndProc()
recursive call (deadlock). I posted this problem but no one reply --so
for the temporary survive i kept a condition for termination (to avoid
deadlock). condition is:
if (m.Msg == (int)Msg.WM_WIN DOWPOSCHANGED)
return;
if condition reaches then control will be returned from WndProc().
We realy can't help you if you are only posting some lines of code, what else are you doing
after this..
if (m.Msg == (int)Msg.WM_WIN DOWPOSCHANGED)
return;
..... // ????

Willy.

Feb 13 '07 #5

protected override void WndProc(ref Message m) {
if (m.Msg == (int)Msg.WM_WIN DOWPOSCHANGED)
return;
base.WndProc(re f m);

switch (m.Msg)
{
case (int)Msg.WM_PAI NT:
PaintBackground ();
break;
case (int)Msg.WM_NOT IFY:
case (int)((int)Msg. WM_NOTIFY + (int)Msg.WM_REF LECT):
{
NMHDR note = (NMHDR)m.GetLPa ram(typeof(NMHD R));
switch (note.code)
{
case
(int)RebarNotif ications.RBN_HE IGHTCHANGE:
UpdateSize();
break;

case
(int)RebarNotif ications.RBN_CH EVRONPUSHED:
NotifyChevronPu shed(ref m);
break;

case (int)RebarNotif ications.RBN_CH ILDSIZE:
NotifyChildSize ();
break;
case (int)Notificati onMessages.NM_N CHITTEST:
break;
}
}
break;
}
}

*** Sent via Developersdex http://www.developersdex.com ***
Feb 14 '07 #6

Hi,

I used PostMessage() instead SenMessage() this avoided blocking i.e.
infinite loop but giving unhandled Exception:

AccessViolation Exception: Attempted to read or write protected memory.
This is often an indication that other memory is corrupt

I searched the cause of this exception but that solutions are not
helping the need (like debugger setting from tools --options)

My application Rebar --toolbar is not visible and Navigations are not
working fine :(

NOTE: POSTMESSAGE() is used only for user coded wndproc() methods still
SENDMESSAGE()ex ists.

IMPORTANT NOTE is all these problems are due to the Utility Library
Rebar --WndProc() handles issue. if we use the new toolstrip from VS
2005 these problems doesnot exists.

There is a necessity with Utility library Rebar --WndProc() --i want
to solve this issue

Please suggest...

*** Sent via Developersdex http://www.developersdex.com ***
Feb 14 '07 #7
Can you get the stack trace of the exception?

"Kalpana Naraboina" <ka************ ***@semanticspa ce.comha scritto nel
messaggio news:ej******** ******@TK2MSFTN GP04.phx.gbl...
>
Hi,

I used PostMessage() instead SenMessage() this avoided blocking i.e.
infinite loop but giving unhandled Exception:

AccessViolation Exception: Attempted to read or write protected memory.
This is often an indication that other memory is corrupt

I searched the cause of this exception but that solutions are not
helping the need (like debugger setting from tools --options)

My application Rebar --toolbar is not visible and Navigations are not
working fine :(

NOTE: POSTMESSAGE() is used only for user coded wndproc() methods still
SENDMESSAGE()ex ists.

IMPORTANT NOTE is all these problems are due to the Utility Library
Rebar --WndProc() handles issue. if we use the new toolstrip from VS
2005 these problems doesnot exists.

There is a necessity with Utility library Rebar --WndProc() --i want
to solve this issue

Please suggest...

*** Sent via Developersdex http://www.developersdex.com ***

Feb 14 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

117
7262
by: Peter Olcott | last post by:
www.halting-problem.com
28
5222
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass(); .... and then call the virtual method, why is it that the base class's method is called instead of the overridden method? How do I fix this if I don't know at runtime what the child class is? I'm using Activator.CreateInstance() to load the...
6
3812
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is less than or equal to 1249 then no problem.
4
12642
by: garth | last post by:
When I running my program in ste-by-step mode I get his error message, it does not seem to apply when running in stand alone mode. What is the best to debug this error message? ContextSwitchDeadlock was detected Message: The CLR has been unable to transition from COM context 0x1a19d8 to COM context 0x1a1b48 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing...
0
1385
by: Jesper | last post by:
Hi, In a single-threaded app I'm getting a ContextSwitchDeadlock MDA everytime I debug the app - in fact - I cant debug my app as I'm iterrupted by this funtionality before I can locate any bug!!!. I've read about how to deactivate this on the net, but none of the tricks work on my app. Please help. regards Jesper, DK.
1
2515
by: Waldy | last post by:
Hi there, every time I try stepping through C# projects in VS 2005, I am plagued by the ContextSwitchDeadlock error messages. Is there any way of avoiding this?
2
3847
by: Connie | last post by:
Dear All, If i step over my visual basic 2005 code, i got this error: The CLR has been unable to transition from COM context 0x1a2008 to COM context 0x1a2178 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...
2
3370
by: =?Utf-8?B?Z3V5?= | last post by:
XP box running a Win 2k3 server in a virual PC for CRM development... Intermittently (once a day ish) when single stepping I get the following exception:- The CL context 0x1a19d8 has been unable to transition from COM Context 0x1a1868 to COM context 0x1a19d8 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...
1
3015
by: =?Utf-8?B?SkI=?= | last post by:
Hello As I debug the C# code with a break point and by pressing F11 I eventually get a message stating: ContextSwitchDeadlock was detected Message: The CLR has been unable to transition from COM context 0x17aeb8 to COM context 0x17abd8 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.
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.