Re: Timer gets stuck




<hagarwal@xxxxxxxxxxxxxxxxxx> wrote in message
news:1139331011.761058.296150@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a TimerTask that downloads e-mails from a POP service, and
processes them. I am using a Timer class with initial delay and period
of 5 seconds.

I have observed that at times, the Timer gets "stuck", as in it fails
to execute the task and then I have to restart the application for the
Timer to be working again.

I initially thought that this was because I did not specify the timeout
in the my connection to the POP service, but aren't the subsequent
executions supposed to be independant of each other, so even if one
execution is halted because of a bad POP service, the next execution
should work just fine.

No, a java.util.Timer runs all of its tasks on a single thread. If one task
hangs, no others will run. Also, if an exception escapes the task, that
will kill the thread and no more tasks will run on it, ever.


.



Relevant Pages

  • Timer gets stuck
    ... I am using a Timer class with initial delay and period ... I have observed that at times, the Timer gets "stuck", as in it fails ... in the my connection to the POP service, ... execution is halted because of a bad POP service, ...
    (comp.lang.java.programmer)
  • Re: Debugging Challenge - no source available
    ... > custom controls. ... > few bitmap operations which use a timer to help time-slice so the UI ... > - the debugger stops at the Application.Runline, there's no call stack, ... > In both cases, the debugger catches execution at the same point, just ...
    (microsoft.public.dotnet.general)
  • Re: How to measure code execution time...?
    ... down clock, to get the execution time on a real processor. ... measure with an external timer. ...
    (comp.arch.embedded)
  • Window messages
    ... Load event handler set a timer for 200ms and the timer's Tick handler will ... In the execution of the Timer event I use a Process.WaitForExit function to ... window messages when my launcher application was running the timer event. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Timer
    ... I am attempting to execute a timer that will generate a number each ... that it creates to an Array. ... Basically, what I want to do is use the outputs (out1, out2) as the ... input arguments for the next execution of the timer function. ...
    (comp.soft-sys.matlab)