Thread never wakes up again if Application does not have focus

G

Guest

I have had this issue before and a check around the groups shows a few other
people have had this problem too with no real resolution.

I have a class that performs actions. These actions are performed
multi-threaded via a ThreadStart in the Main Form.
The method that performs this is in a while loop that never exits unless the
form exits. It will sleep for 30 seconds after it has performed its action
and then it will cycle through the loop again.

This works fine and dandy but it seems that if the application does not have
focus after multiple executions the thread goes to sleep and never wakes up.
This randomly happens after about 30-60 minutes of running in the
background.
I am wondering if anybody else has ever experienced this problem and
whether there were any fixes that they had come up with.
 
C

Calvin Luttrell

Dear Recoil,

How many threads are we talking about? I would suggest using a thread pool which sounds like you are ultimately trying to do.


-Calvin Luttrell
ProjectThunder.com, Inc.
nothing is impossible
 
J

Jeffrey Tan[MSFT]

Hi,

Thanks for your posting!!

Is there any consistent steps you can provide for us to reproduce this
problem? With the reproduce steps, we can understand this issue better, and
do some debugging into this issue.

Yes, I also see that this problem randomly occurs. Is there any extra
information to help us address this issue? I suggest you migrate your
project to another machine to see if this issue still exist. Then we can
determine if this issue is due to specific machine.
===============================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
M

marc.derider

It is a single thread which is why I did not feel the need for a thread
pool.
My application starts up.
Simplisticaly you merely press a button.
This spawns a thread which at 30 second intervals begins polling a pop3
mail server.
A socket does the actual checking. I am not sure if this runs on its
own separate thread or not. But it is basically a single thread that
does not wake up

At some random point happening within under 30 minutes to 8 hours the
thread just never wakes up .

Currently I do not have much of a repro scenario other then to leave
the application running in the background for a length of time. In this
case I left it running over saturday afternoon and it stopped
responding sometime that evening. It went to sleep and never woke up
again.

I have had this issue happen before in other applications but I have
never needed the application to run for days on end. I do need this
application to be able to.
 
J

Jeffrey Tan[MSFT]

Hi marc,

Thanks for your feedback!!

Yes, I see your concern. Looking at the nature of this issue, it is
difficult for the newsgroup community to reproduce out the problem and help
you find out the root cause. I think it would be more helpful if you can
get direct assistance from a Microsoft Support Professional through
Microsoft Product Support Services. Then you will get a one-by-one engineer
for your specific issue, he will help you do some memory dump or deep
debugging for this issue.

You can contact Microsoft Product Support directly to discuss additional
support options you may have available, by contacting us at 1-(800)936-5800
or by choosing one of the options listed at
http://www.microsoft.com/services/microsoftservices/supp.mspx.

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
M

marc.derider

I may have to look into that. Right now I appear to have resolved the
problem by recruiting a military RDC to watch over the thread and wake
it up if it does not execute in a timely fashion. I am currently
achieving this with a Timer on the form that but I would eventually
like to get down to the bottom of this since I have seen this problem
creep into several applications.
 
J

Jeffrey Tan[MSFT]

Hi marc,

Yes, this is really an annoying problem. If you need further assistant on
contacting Microsoft PSS, please feel free to tell me. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top