简体   繁体   English

如何学习线程安全的c#编程?

[英]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#? 如何开始学习c#中的线程安全programmimg? what is role of thread in web development ? 线程在Web开发中的作用是什么?

我希望你在这里阅读: 线程(C#和Visual Basic)

For .NET threading in general, I find the following link very useful: Threading in C# by Joseph Albahari. 对于一般的.NET线程,我发现以下链接非常有用:由Joseph Albahari 在C#中进行线程化。

For the last question, I would start with the following articles depending on which technology you are using: 对于最后一个问题,我将根据您使用的技术开始以下文章:

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 . 此外,下面的文章解释了IIS在IIS 7.0和IIS 6.0上托管时如何使用线程: IIS 7.0和6.0上的ASP.NET线程使用情况 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. 该链接也有点旧,但它涵盖了.NET 3.5 sp1,所以它也可以是一个很好的起点。

如果你想要比MSDN参考更多的实际操作,我建议你阅读这个免费的电子书

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. 在C#中创建线程并使用它们很容易,但要使它们安全是很困难的。 I would recommend this article http://codebetter.com/matthewpodwysocki/2008/09/12/side-effects-and-functional-programming/ 我会推荐这篇文章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. 我不是首先专门研究c#,而是从了解并发的基础知识开始。 IE) What is locking? IE)什么是锁定? 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. IMO是一个很好的起点, 这个网站是由澳大利亚Swinburne大学创建的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM