Results 1 to 4 of 4

Thread: ContextSwitchDeadlock was detected

  1. #1

    Thread Starter
    Hyperactive Member Art W.'s Avatar
    Join Date
    Apr 2002
    Location
    In My Own Little World, But that’s OK because they know me there!
    Posts
    271

    ContextSwitchDeadlock was detected

    Hello Everyone:

    I keep getting the following message when I run my program. I have no idea what it means or what I need to do to fix?

    ContextSwitchDeadlock was detected
    Message: The CLR has been unable to transition from COM context 0x1b2008 to COM context 0x1b2178 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.


    Thanks

    Art
    SLEEP: A Totally Inadequate Substation For Caffeine!

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,480

    Re: ContextSwitchDeadlock was detected

    do you have any long running loops in your program?

  3. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,480

    Re: ContextSwitchDeadlock was detected

    use application.doevents, or a backgroundworker. for example:

    vb Code:
    1. for x as integer = 1 to 1000000
    2.     doSomething
    3.     'insert doevents here
    4.     application.doevents
    5. next

  4. #4

    Thread Starter
    Hyperactive Member Art W.'s Avatar
    Join Date
    Apr 2002
    Location
    In My Own Little World, But that’s OK because they know me there!
    Posts
    271

    Re: ContextSwitchDeadlock was detected

    Hi Everyone:

    Yes I have two loops running
    SLEEP: A Totally Inadequate Substation For Caffeine!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width