المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Windows Service: Timer vs Thread



C# Programming
07-17-2013, 05:24 AM
Hello All,

I was wanting to start a discussion about best practice when creating threads in a Windows Service.

I have a service that has multiple process running at the same time (6-10). Is it better to use timers or threads? I personally prefer threads because I can end them all with a single line of code where as if have to end each timer individually. Plus with threads, you don't have to worry about it calling it self until you want it to.

Does anybody have any other thoughts on this? What's a better way to go and why? Which is lighter on PC usage and memory? etc etc

Thanks in advance,
Bryan