Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# Windows application not responding after 30 minutes

C# Windows application not responding after 30 minutes

Scheduled Pinned Locked Moved C#
questioncsharp
13 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Dave Kreskowiak

    Is the UI thread blocked? Are you doing som long running operation on the UI thread?? Chances are good one of these two things is what's doing it.

    A guide to posting questions on CodeProject[^]
    Dave Kreskowiak

    P Offline
    P Offline
    Peter_in_2780
    wrote on last edited by
    #4

    Is there any reason you sig has enough blank lines to score scrollbars? Just curious. Cheers, Peter

    Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

    D 1 Reply Last reply
    0
    • P Peter_in_2780

      Is there any reason you sig has enough blank lines to score scrollbars? Just curious. Cheers, Peter

      Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #5

      Hmmm...it never did before. I'll take a look.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      P 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Hmmm...it never did before. I'll take a look.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        P Offline
        P Offline
        Peter_in_2780
        wrote on last edited by
        #6

        Another victim of metrosexualisation? I've since noticed a couple of others in the same boat. Cheers, Peter

        Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

        D 1 Reply Last reply
        0
        • S sujithkumarsl

          I know this is not a clear question, but this is the situation. I have a windows application which parse some file( i use TPL here). If i minimize this application and keep idle for more than 30 minutes, then i cannot bring the application back. I can see the minimized icon, but this wont come back even if i do ALT-TAB. This is in windows 7. Any idea?

          My small attempt...

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #7

          Ditto dave's answer, your UI thread is probably blocked. To resolve this: Add a BackgroundWorker and create a DoWork handler. Move your parsing code into there. Where your parsing code was, call RunWorkerAsync on the BackgroundWorker. ... now your parsing will be done on a background thread so your UI will remain active. You can use ReportProgress with a ProgressChanged handler to pass back info to the UI thread if needed.

          Dave
          Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

          S 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Is the UI thread blocked? Are you doing som long running operation on the UI thread?? Chances are good one of these two things is what's doing it.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak

            S Offline
            S Offline
            sujithkumarsl
            wrote on last edited by
            #8

            I dont think that the GUI thread is blocked, because using TPL I parse all the files. Then show the result in the grid. I am minimizing the application after all these operations are completed. That mean app is Idle when i minimize. If i maximize the app immediately or like after 5. 10 minutes, then i am ok. But after 30-40 minutes i am having issue. I also use DEV Express grid o show the result.

            My small attempt...

            1 Reply Last reply
            0
            • D DaveyM69

              Ditto dave's answer, your UI thread is probably blocked. To resolve this: Add a BackgroundWorker and create a DoWork handler. Move your parsing code into there. Where your parsing code was, call RunWorkerAsync on the BackgroundWorker. ... now your parsing will be done on a background thread so your UI will remain active. You can use ReportProgress with a ProgressChanged handler to pass back info to the UI thread if needed.

              Dave
              Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
              BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

              S Offline
              S Offline
              sujithkumarsl
              wrote on last edited by
              #9

              Thanks Dude, instead of BackgroundWorker is use Task and continue with. Is there any way to check, what went wrong when i got this situation again?

              My small attempt...

              D 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Is the UI thread blocked? Are you doing som long running operation on the UI thread?? Chances are good one of these two things is what's doing it.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak

                S Offline
                S Offline
                sujithkumarsl
                wrote on last edited by
                #10

                I just told about file parsing, but this behavior may not be related to that. Below is another strange behavior i am seeing. This is happening only sometimes, which may/may not related to our issue. Say i have opened any popup window or some applications ( like MS word, IE) from my main form. When I close that popup window/app then the main form will be minimized or some other app will come front. So i had to click the app icon from task bar to bring it back

                My small attempt...

                1 Reply Last reply
                0
                • P Peter_in_2780

                  Another victim of metrosexualisation? I've since noticed a couple of others in the same boat. Cheers, Peter

                  Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #11

                  It appears that way! There were a couple of BR tags under my name that I don't remember placing there. Anyway, all fixed. Thanks!

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak

                  1 Reply Last reply
                  0
                  • S sujithkumarsl

                    Thanks Dude, instead of BackgroundWorker is use Task and continue with. Is there any way to check, what went wrong when i got this situation again?

                    My small attempt...

                    D Offline
                    D Offline
                    DaveyM69
                    wrote on last edited by
                    #12

                    Not that I know of, but a good rule for any application that has a UI is to perform potentially long running tasks on another thread so the UI doesn't freeze.

                    Dave
                    Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
                    BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

                    S 1 Reply Last reply
                    0
                    • D DaveyM69

                      Not that I know of, but a good rule for any application that has a UI is to perform potentially long running tasks on another thread so the UI doesn't freeze.

                      Dave
                      Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
                      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

                      S Offline
                      S Offline
                      sujithkumarsl
                      wrote on last edited by
                      #13

                      Thanks Dave, i will get back soon after resolving this issue

                      My small attempt...

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups