New Posts New Posts RSS Feed: ContextSwitchDeadlock
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

ContextSwitchDeadlock

 Post Reply Post Reply
Author
DocScooter View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 7
Post Options Post Options   Quote DocScooter Quote  Post ReplyReply Direct Link To This Post Topic: ContextSwitchDeadlock
    Posted: 09-Mar-2008 at 9:05am

I don't know if it is something in my code or something in DevForce that gives me a time out error.  I can persist smaller tables one at a time just fine but try that with a table with more substance....I get a time out message.  Is there some setting I can make to increase the time out length?  tnx.

Here's the whole error message:

ContextSwitchDeadlock was detected

Message: The CLR has been unable to transition from COM context 0x1afdd0 to COM context 0x1aff40 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 operation

Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 09-Mar-2008 at 9:43am
This is a fairly common occurrence debugging with Visual Studio, and has nothing to do with DevForce.  Either the operating system or the .NET Framework expects that certain code sequences will complete in a certain amount of time or they will throw a timeout.  When you set breakpoints in your code, you may cause this timeout to occur.  I know of nothing you can do to change this although you might do research on the Web on this topic.  I would try moving my breakpoints around.  If you add debugging or trace messages in your code, this usually helps because then you are not stopping the execustion of the code.
Back to Top
DocScooter View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 7
Post Options Post Options   Quote DocScooter Quote  Post ReplyReply Direct Link To This Post Posted: 10-Mar-2008 at 4:20am
I was developing at work with a fast WAN connection.  But I got the error messages when I tried it at home through a wireless connection to my cabled router....probably a typical remote office setup for my users. 
 
When I drove the program from the exe it worked fine.  Then I removed the breakpoints as suggested and now all is well again.  I thought I was going to have go back to the drawing boards. 
 
Thanks David! 
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1278
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 10-Mar-2008 at 11:26am
You can also try turning off the managed debugging assistant for this.  By default, the ContextSwitchDeadlock MDA is set to throw, and does interfere with debugging.  You can turn this off from the Exceptions window in VS.
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down