Phreak3eb
asked on
Threading a Timer Object
I'm writing a Windows service in C# that needs to periodically, e.g. every minute, check a POP3 mailbox and grab some emails. The problem being, is that it may take longer than a minute for it to complete processing. I've been doing some digging on the net and EE on how I might do this and have come up empty. Here's what I need:
A timer object to fire every 1-5 minutes and start a new thread if needed to do the processing.
A timer object to fire every 1-5 minutes and start a new thread if needed to do the processing.
Instead of timer user thread. so you can manage each thread separately and you set time interval for thread also.
Instead of timer use thread. so you can manage each thread separately and you set time interval for thread also.
ASKER
Could you give a little more detail? I guess I don't understand what you mean...?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just use boolean flag to say the job isn't done yet and that it will be for the next 3 minutes.
ASKER
Thanks for all of your help. Both solutions from Idle Mind and gregoryyoung will work and give me a couple options to work with.