Beginners threading in C#

Can you recommend a good series of articles or preferably a book on how to get started with threading in general and in C# in particular?
I am primarily looking for the use of threads in console applications and in ASP.Net apps.

I understand only the very basics of threads and know that “here be dragons”, so want to get a good grounding in it before I start using them.

Things I am curious about are things like the concept of having a threadpool, how you manage the size of it, how you choose for things to be queued until a thread is available vs forcing a new thread to start etc.
Also, I understand that IIS has lots of built-in thread handling, so anything that explains how to work with threads in ASP.Net under IIS and how it differs from threading in a console C# applicaion is interesting.

My intended usage includes things like;

  • The user does something on the ASP.Net page that causes my server-side code to need to connect to another system and carry out lengthy operations, so I want to return control to the user quickly by firing that action to another thread. The user can keep watching progress through AJAX or simply move away – the web is stateless after all 🙂
  • Use of Fire and Forget patterns (lots of sample code out there, I want to understand more about how they work)

Thanks

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

As well as my own articles linked by Andrew, Joe Albahari has another tutorial.

If you want a really thorough examination, read Joe Duffy’s Concurrent Programming in Windows.

Method 2

Here is a good set of articles by our very own Jon Skeet:

http://www.yoda.arachsys.com/csharp/threads/

Method 3

I found this free ebook by Joseph Albahari really useful

Method 4

I would recommend the series by Joseph Albahari available here:

http://www.albahari.com/threading/

It’s concise and very readable.

Method 5

I’d recommend the following

Great MSDN Article

Method 6

Get “CLR Via C#” by Jeff Richter. Its the best .Net book I have ever read and has extensive information on threading.

alt text


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x