multithreading - Windows Service and Timers - Separate Processes? -


What is the difference between multiple timers versus multiple threads?

I have a Windows service that runs in the background. There are about ten "sites" in that database that are loaded on the int. Each site is started in its timer object, and then the timer executes the code at intervals for each site. The code executed is from a static method in the main service class.

What happens when two timers are executed at the same time? Are they executing in the same process? Does it have to wait for the first timer to exit it before entering any other timer? Are there any locking or running conditions to worry?

Thanks for the insights.

I think this is a .net question.

The timers use threads shared in those applications' thread pools.

Multiple timer callbacks will be executed concurrently, until the thread ends with the pool thread.

Compare it to using dedicated threads. Dedicated threads will always be available to execute the code, but they keep the resources tied because they are not shared in the pool as threads.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -