Summary

 < Day Day Up > 



Synchronization is an extremely important concept in this multithreaded world of enterprise computing. It is extensively used in popular applications like databases, message queues, and even web servers. Any developer developing multithreaded applications needs to have their synchronization concepts crystal clear. Rather than getting overwhelmed with the locking features and trying to make every object thread-safe, the developer should focus on deadlock scenarios and try to resolve as many deadlock conditions as possible right from the design stage of the application. It is also important to understand the performance hit associated with synchronization and how it will affect the overall performance of your application. In this chapter, along with the synchronization support in the .NET Framework, we also developed a couple of useful applications:

  • A custom thread-safe wrapper. In this example, you learned how you can add intrinsic synchronization support to your library and give the application developer the choice of using synchronization or not. This will help the developer focus on their own application rather than worrying about the thread safety of the library.

  • A database connection pool. In this example, you developed a generic object pool that can be used for pooling any type of similar objects. Following that, we developed a database connection pool inheriting from the object pool. The object pool can be reused to pool any kind of object.



 < 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