S
sri mallu
I am writing an application which would send a message for a
particular country at midnight (localtime). I have about 100 such
countries and I have to also be mindful of daylight savings. I can
only think of 2 ways to do this: 1. Create a corresponding thread for
each country and which wakes up every hour or so and checks if it is
midnight(local time) and send out the message. So essentially, I will
be creating 100 threads doing nothing most of the time.
2. In this approach, there will be only one timer which checks every
minute or 30 secs the local time for 100 countries and send message.
There will need to be some extra logic as there will never be an exact
midnight match.
Not sure, if there is any better way to tackle above situation. It
would be great if I can get some ideas/suggestions here.
Thanks, SP.
particular country at midnight (localtime). I have about 100 such
countries and I have to also be mindful of daylight savings. I can
only think of 2 ways to do this: 1. Create a corresponding thread for
each country and which wakes up every hour or so and checks if it is
midnight(local time) and send out the message. So essentially, I will
be creating 100 threads doing nothing most of the time.
2. In this approach, there will be only one timer which checks every
minute or 30 secs the local time for 100 countries and send message.
There will need to be some extra logic as there will never be an exact
midnight match.
Not sure, if there is any better way to tackle above situation. It
would be great if I can get some ideas/suggestions here.
Thanks, SP.