C# Windows application not responding after 30 minutes
-
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...
-
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...
Can you try this ? - Right-click on the taskbar and say "Show windows side by side" Another option : You may put a timer in your application with this Code:
MessageBox.Show(this.Location.ToString() + "\\r\\n" + this.Size.ToString() + "\\r\\n" + this.WindowState.ToString()); this.WindowState = FormWindowState.Normal; timer1.Enabled = false;
and repost the result here ?
-
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...
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 -
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 KreskowiakIs 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
-
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
Hmmm...it never did before. I'll take a look.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Hmmm...it never did before. I'll take a look.
A guide to posting questions on CodeProject[^]
Dave KreskowiakAnother 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
-
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...
Ditto dave's answer, your UI thread is probably blocked. To resolve this: Add a
BackgroundWorker
and create aDoWork
handler. Move your parsing code into there. Where your parsing code was, callRunWorkerAsync
on theBackgroundWorker
. ... now your parsing will be done on a background thread so your UI will remain active. You can useReportProgress
with aProgressChanged
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) -
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 KreskowiakI 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...
-
Ditto dave's answer, your UI thread is probably blocked. To resolve this: Add a
BackgroundWorker
and create aDoWork
handler. Move your parsing code into there. Where your parsing code was, callRunWorkerAsync
on theBackgroundWorker
. ... now your parsing will be done on a background thread so your UI will remain active. You can useReportProgress
with aProgressChanged
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)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...
-
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 KreskowiakI 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...
-
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
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 -
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...
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) -
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)Thanks Dave, i will get back soon after resolving this issue
My small attempt...