Summary

 < Day Day Up > 



In this chapter we introduced the System.Threading namespace and examined the Thread class in detail. We also discussed some basic ideas to help you hone your decision making skills when it comes to multithreading your applications. You must always keep in mind the fact that threads require resources. Before you consume those resources, analyze what affect their use will have on the system and how you can minimize that overhead. You should consider creating a thread if you are accessing outside resources such as a network share or remote databases. You should also consider spawning a new thread when you plan to execute a lengthy process such as printing, I/O operations, or background data processing.

Whatever your situation, keep the number of your threads to a minimum. You will reduce the overhead on your processor, increase the amount of time that your time slice uses to process instructions within your thread, and reduce the amount of memory required by your application.



 < Day Day Up > 



C# Threading Handbook
C# Threading Handbook
ISBN: 1861008295
EAN: 2147483647
Year: 2003
Pages: 74

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net