Reddit Reddit reviews Concurrency in C# Cookbook: Asynchronous, Parallel, and Multithreaded Programming

We found 9 Reddit comments about Concurrency in C# Cookbook: Asynchronous, Parallel, and Multithreaded Programming. Here are the top ones, ranked by their Reddit score.

Computers & Technology
Books
Computer Programming
Software Design, Testing & Engineering
Object-Oriented Design
Concurrency in C# Cookbook: Asynchronous, Parallel, and Multithreaded Programming
O Reilly Media
Check price on Amazon

9 Reddit comments about Concurrency in C# Cookbook: Asynchronous, Parallel, and Multithreaded Programming:

u/ThereKanBOnly1 · 7 pointsr/csharp

There's a lot of good answers here, but I'm going to take a more abstract position. I'd argue that the point of async/await is to not have to worry about, or understand all the minute mechanics of, writing asynchronous code.

As many stated, what you might need those asynchronous operations for might be something as straight forward as some disk I/O, a database call, a network call, or maybe even a long running computation of some sort. Without async/await, you're simply waiting for those to finish, rather than being able to switch contexts and do something else.

Maybe you don't need to, and that's fine. Not every application needs async calls, but chances are it can be useful to quite a large number of cases.

Fundamentally, the threading model is simply too complex, full of far too many pitfalls, and far too inaccessible to be widely used and widely effective for the vast majority of .Net programmers. Async/await is a different approach to programming for concurrency that puts the onus on the framework itself, and with a little imposition on the programmer, allows the programming of concurrent operations that would be largely impossible for a lot of us.

That is the advantage. Don't worry about threads, because as Stephen Cleary has said, once you write code with threads, it's already legacy code.

u/KryptosFR · 6 pointsr/csharp

You beat me to it :)

Another recommendation is Concurrency in C# Cookbook by Stephen Cleary. It is easy to read, even on a trip. But you might want to do that at the end of said trip because it will make you want to experiment it yourself.

u/RedditWithBoners · 3 pointsr/csharp

I purchased TCP/IP sockets in C a while back, and at the time was working a job doing Linux network development. So, seeing the low-level APIs and diving straight into the work is what I recommend, but I know it's not the most accessible route. Unfortunately, I don't have any other book references as the majority of my understanding is documentation, blogs, and code. Honestly, my knowledge of sockets in Windows is far from complete.

There is a regular poster to /r/csharp who writes a series of articles and code about networking in C#. I believe he started from simply opening a socket, then continued onto TCP, UDP, and eventually creating a networked game. Surprisingly, I came across this when I was trying to find his posts. You might have better luck searching reddit (I only searched Google).

As for async, I purchased Stephen Cleary's book Concurrency in C# Cookbook and Alex Davies' book Async in C# 5.0, but I have barely cracked open either. :( Stephen Cleary's blog has a significant wealth of information on how async/await works, and things to do and avoid. Once you get over a few humps, MSDN's documentation is pretty thorough and readable as well.

Edit:
Found the networking series I mentioned above - https://16bpp.net/tutorials/csharp-networking/, written by /u/def-pri-pub.

u/markdoubleyou · 3 pointsr/csharp

As others have mentioned, writing code is the best way to get exposure. But if you're a book guy like me then there are a lot of option out there that'll accelerate the process. You'd be insane to read all the following--these are just starting points that can accommodate different interests/tastes.

Having said that, I'll start with the one book that I think every C# developer should own:

Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries

... it's a good read, and it includes a lot of direct input from the designers of the C# and the .NET Framework. Microsoft has been really good about sticking to those guidelines, so you'll immediately get a leg up on the Framework libraries if you work through this book. (Also, you'll win a lot of arguments with your coworkers about how APIs should be designed.)

General knowledge books (tons to pick from, but here are some winners):

u/Liam2349 · 2 pointsr/csharp

The event handler is synchronous. The main thread cannot process both the event handler and the UI at the same time. This means the method is processed, and once that is finished, the main thread can resume processing the UI.

To solve your problem, you need to make the event handler "async void" and "await" Task.Delay, rather than ".Wait()"-ing it. When you "await", you will free up the thread to process other things, which in this case is the UI.

You don't have this problem with your other method because it's not running on the main thread. Since you "Task.Run()"-ed the method, it's running on the thread pool, and you are delegating units of work back to the main thread.

It seems like you're new to ideas of parallel and asynchronous processing, so I recommend you read some of Stephen Cleary's book: https://www.amazon.co.uk/Concurrency-C-Cookbook-Stephen-Cleary/dp/1449367569/ref=sr_1_1?ie=UTF8&qid=1523129261&sr=8-1&keywords=stephen+cleary

u/zabi15 · 1 pointr/learnprogramming

try cookbooks https://www.amazon.ca/Concurrency-Cookbook-Asynchronous-Multithreaded-Programming/dp/1449367569/ref=asc_df_1449367569/?tag=googleshopc0c-20&linkCode=df0&hvadid=292950359971&hvpos=1o1&hvnetw=g&hvrand=2094012217590572301&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9000633&hvtargid=pla-330197456780&psc=1

​

​

you can probably find free pdfs or something.

never tried it for c# but i used cookbooks for sql and c++

the way they work is they give you a bit of theory and then give good exercises to do.

i find them really good.

other ways would be to follow a lesson plan on c# and then find lots of exercises online about that chapter.

example:

you just studied the chapter on if statements, had 1 exercise and then it continued to next chapter. what you can do is google for if statements exercise for c#, there are load of em. and if you need more just look for exercises in any language and do them in c#. anything beginner level should be possible to do in most languages.

anyway good luck man c# is fun,

u/piglet24 · 0 pointsr/csharp

Always use tasks. In Stephen Cleary's book he even writes "As soon as you type new Thread(), it’s over; your project already has legacy code."