How to learn thread safe c# programming?
I开发者_开发问答 want to know what is thread safe ? how to start to learn thread safe programmimg in c#? what is role of thread in web development ?
i would prefer you to read here: Threading (C# and Visual Basic)
For .NET threading in general, I find the following link very useful: Threading in C# by Joseph Albahari.
For the last question, I would start with the following articles depending on which technology you are using:
- For web form: Asynchronous Pages in ASP.NET 2.0 (a bit old but should still be relevant)
- For asp.net mvc: Using an Asynchronous Controller in ASP.NET MVC
Also, the following article explains how ASP.NET uses threads when hosted on IIS 7.0 and IIS 6.0: ASP.NET Thread Usage on IIS 7.0 and 6.0. The link is also a bit old but it covers up to .NET 3.5 sp1, so it could be a good start point as well.
sure! take reference for startup : http://msdn.microsoft.com/en-us/library/aa645740.aspx
If you want a more hands on approach than the MSDN reference I would suggest you read this free ebook .
As you are new to programming I would recommend you read a bit about functional programming and side effects. Creating threads and using them is easy in C# but making them safe is difficult. I would recommend this article http://codebetter.com/matthewpodwysocki/2008/09/12/side-effects-and-functional-programming/
Concurrent programming is a vast an extremely complicated area. Rather than looking specifically at c# to begin with I would start by learning about the basics of concurrency. IE) What is locking? What is a Mutex, Latch, and Concurrent Queue, and why do we need to use them? IMO, a good place to start would be this site created by Swinburne University in Australia.
精彩评论