I consider this to be best practice.
This sample codes requires the knowledge of multi-threading.
1.) It examines two models.
1.1.) Single timer multiple tasks model.
1.2.) Multiple timer objects model.
2.) Reentrancy Issues:
For both model, reentrancy will still happen. In fact, reentrancy cannot be avoided, it can only be mitigated.
2.1.) Try to use system.threading.timers and asynchronous processing. System.timers.timer are more for synchronous processing.
2.2.) Design the program in such that if previous scheduled task is not yet completed, ignore current task schedule and come back later.
3.) CPU Utilization:
Both models have the about the same CPU utilization, with single timer model suffers slightly higher CPU.
The bottleneck is happening at refreshing text at 'System.Windows.Forms.Label'
The more GUI refreshes is made, the high CPU utilization and the slower data gets to be displayed real time.
4.) Benefits of Single Timer Multiple Tasks Model:
Improve manageability, single point of troubleshooting, single point of view.
4.1.) Reduce the possibility of deadlock.
4.2.) Reduce the possibility of exceptions.
5.) Conclusion
5.1 Both models are workable.
5.2 It is not necessary to deploy the single timer multiple tasks model, which will give rise to more bottlenecks and more CPU utilization. Using multiple timer objects proves to be more optimized.
5.3) The most important thing is to mitigate Reentrancy.
Download the (sample code)VB.NET Visual Studio 2008 SP1
Other References:
Also refer to 'System.Timers.Timer Vs System.Threading.Timer'
And 'System.timers.timer hung or hangs'
This sample codes requires the knowledge of multi-threading.
1.) It examines two models.
1.1.) Single timer multiple tasks model.
1.2.) Multiple timer objects model.
2.) Reentrancy Issues:
For both model, reentrancy will still happen. In fact, reentrancy cannot be avoided, it can only be mitigated.
2.1.) Try to use system.threading.timers and asynchronous processing. System.timers.timer are more for synchronous processing.
2.2.) Design the program in such that if previous scheduled task is not yet completed, ignore current task schedule and come back later.
3.) CPU Utilization:
Both models have the about the same CPU utilization, with single timer model suffers slightly higher CPU.
The bottleneck is happening at refreshing text at 'System.Windows.Forms.Label'
The more GUI refreshes is made, the high CPU utilization and the slower data gets to be displayed real time.
4.) Benefits of Single Timer Multiple Tasks Model:
Improve manageability, single point of troubleshooting, single point of view.
4.1.) Reduce the possibility of deadlock.
4.2.) Reduce the possibility of exceptions.
5.) Conclusion
5.1 Both models are workable.
5.2 It is not necessary to deploy the single timer multiple tasks model, which will give rise to more bottlenecks and more CPU utilization. Using multiple timer objects proves to be more optimized.
5.3) The most important thing is to mitigate Reentrancy.
Download the (sample code)VB.NET Visual Studio 2008 SP1
Other References:
Also refer to 'System.Timers.Timer Vs System.Threading.Timer'
And 'System.timers.timer hung or hangs'
Comments
if my attribute is address, which datatype should i use ? usually i use varchar. (i' using mysql db)
i'm still new in .net :)
Also visit my homepage: pay day loans fast Cash
Feel free to surf to my homepage ... fast online loans
I ѕtumbled upоn this I havе ԁіscovered It absolutely useful and it has aіded me out loads.
I am hoping to gіve а contribution & help оtheг
customers lіκе its aided mе.
Great job.
my web pagе ... Cash Fast
Google, and found that it's truly informative. I am gonna watch out for brussels. I will be grateful if you continue this in future. Numerous people will be benefited from your writing. Cheers!
Feel free to surf to my website - hcg extreme
Worth гemembering.
Also ѵіsit my sіte :: online fast cash loans
to worκ aѕ it should this time, I cаn actuallу reply.
Јust to sау, I would not do it myself.
Feel free to surf to my blog pоѕt: fast cash advance loan
Mine alwayѕ seem to ωаffle on, yоurѕ iѕ nice and snappy.
Here is my web ѕite ... fast easy payday loan
My web page ... http://www.jobinterviewanswers.biz/2013/01/24/hello-world/?do=basic
google android. Μaybe I oughtа quit life.
Hеre is my web site - long term loans
least bit of sеnse.
Here iѕ my ѕite: bad credit personal loans
Take a look at my website: best loans