A
Antonio
Hello, I am using a timer object (System.Timers.Timer) in my windows
service. The timer will elapse every 5 minutes and look for a signal
that has arrived during the 5 minutes it was sleeping. If a signal has
arrived, the ElapsedEventHandler will kick off my method that starts
processing the task that it needs to do. But if the task takes 7
minutes to run, what happens at the 5 minute mark? I think it will
kick off on another thread. Is that right? The ElapsedEventArgs class
says
"Any public static (Shared in Visual Basic) members of this type are
thread safe. Any instance members are not guaranteed to be thread
safe."
is there something I have to do to keep my windows service "thread
safe" or is it already thread safe?
All that the process does when it gets a signal is to run a long stored
procedure and place the results in a excel file, zip the file, and
email the file to the requester.
Thank you.
service. The timer will elapse every 5 minutes and look for a signal
that has arrived during the 5 minutes it was sleeping. If a signal has
arrived, the ElapsedEventHandler will kick off my method that starts
processing the task that it needs to do. But if the task takes 7
minutes to run, what happens at the 5 minute mark? I think it will
kick off on another thread. Is that right? The ElapsedEventArgs class
says
"Any public static (Shared in Visual Basic) members of this type are
thread safe. Any instance members are not guaranteed to be thread
safe."
is there something I have to do to keep my windows service "thread
safe" or is it already thread safe?
All that the process does when it gets a signal is to run a long stored
procedure and place the results in a excel file, zip the file, and
email the file to the requester.
Thank you.