If you're one of many developers still uncertain about concurrent and multithreaded development, this practical cookbook will change your mind. With more than 85 code-rich recipes in this updated second edition, author Stephen Cleary demonstrates parallel processing and asynchronous programming techniques using libraries and language features in .NET and C# 8.0.
Concurrency is now more common in responsive and scalable application development, but it's still extremely difficult to code. The detailed solutions in this cookbook show you how modern tools raise the level of abstraction, making concurrency much easier than before. Complete with ready-to-use code and discussions about how and why solutions work, these recipes help you:
Get up to speed on concurrency and async and parallel programming Use async and await for asynchronous operations Enhance your code with asynchronous streams Explore parallel programming with .NET's Task Parallel Library Create dataflow pipelines with .NET's TPL Dataflow library Understand the capabilities that System.Reactive builds on top of LINQ Utilize threadsafe and immutable collections Learn how to conduct unit testing with concurrent code Make the thread pool work for you Enable clean, cooperative cancellation Examine scenarios for combining concurrent approaches Dive into asynchronous-friendly object-oriented programming Recognize and write adapters for code using older asynchronous styles
There are quite a few mistakes in the book. There is an errata of this book out there that explains the typos and the compilation errors - so some examples will not work.
For someone who has no understanding of the concepts explained (such as Parallel, Async with Task and await, Reactive Extensions) then you would need to complement the material here with other books or video tutorials. Reason being is because the way these concepts are explained was a bit difficult to grasp at first. However, I did like the examples given and its use cases.
Knihu jsem přečetl v "preview" verzi, takže je možné, že papírová kniha bude lepší.
Na knihu od Stephena Clearyho jsem se těšil, ale netuším, pro koho je určena. Autor popisuje v samostatných "receptech", které připomínají krátké blogspoty, klíčová slova async a await v C#, TPL, RX Framework i TPL Dataflow. Pochybuju, že ten, kdo o těchto knihovnách moc neví, tak se z krátkých kapitol naučí knihovny používat, nebo alespoň pochopí, proč by se o ně měl zajímat, a pro čtenáře, kteří hledají pokročilá témata, je v knize minimum textu.
This book contains a series of recipes around different kind of problems for concurrent and asynchronous programming mostly seen in c#. The author goes deeper into the technical details when needed but the book still remains easy to read. I would recommend it as an additional learning ressource
In Cleary's own blog you will find a lot more interesting details but do not set your hopes too high; this small book gives nothing beyond what you can read in any general book on C#(Nagel, Schildt, Troelsen etc)
The book is written in a "here's a problem, and this is how you can solve it" style. As a result, it has many examples that helps understand the concepts clearly. This also assists with solidifying the basics.
This is one of the best books i have read so far regarding concurrency. Although i am usually skeptical about reading books for a specific language , Stephen did a tremendous job with this one and i have already adopted a bunch of hia techniques right after reading his book.
This book is like a wikipedia for concurrency/parallelism, reactive and asynchronous programming. The author goes to great lengths to display all kinds of nasty scenarios that you could get yourself into when developing complex code and pragmatically offers the most elegant solution(s) from worst to best.
The aspect that i loved about the book is that he doesn't focus on the basics of concurrency because as he puts it "there are a plethora of resources out there".He instead focuses on the newest frameworks and libraries (thoroughly tested by the .NET team of course) that will help you get your job done with minimal effort and headaches. He is basically teaching the reader how to write a modern .NET application and how to leverage the goodies of the language.
He treats Rx,TPL Dataflow (mind blowing for me) , PLINQ , regular TPL , async-await , concurrent/immutable collections , events , task schedulers , synchronization contexts, cancellations , synchronization primitives and many more.
Best .NET book i have read so far and one of the best resources on concurrent programming !
"The moment you write -Thread.StartNew()- your application is gone into legacy code."
- небольшая книга - понятный и лаконичный стиль изложения, без воды - структура книги в виде рецептов для решения конкретных задач. Задачи не высосаны из пальца и действительно встречаются на практике.
Что не совсем понравилось:
- в книге заметная часть материала посвящена реактивному программированию (`Rx.NET`) и библиотеке `TPL.Dataflow`. В своей практике я не сталкивался с ними и пока не вижу, где бы они были полезны мне в бекенд разработке. С другой стороны было неплохо узнать о их существовании и возможной области применения. - часть рецептов посвящена third-party библиотеке `Nito.AsyncEx` (в ее разработке участвовал автор книги). Я предпочитаю, когда в книгах рассматриваются лишь стандартные инструменты, что делают ее чуть более долговечной/актуальной. - некоторым темам хотелось бы уделить чуть больше внимания (например, использование `ConfigureAwait(false)` или продвинутых примитивов синхронизации или про `Lazy>`) - некоторые рецепты и информация уже не столь актуальны для .NET 8. Было бы здорово, дождаться переиздания данной книги :)
Общее впечатление:
- не жалею, что прочитал - хотя многие вещи, описанные в книге, я уже знал, удалось структурировать знания по теме конкурентности в .net. - книга не столько про "в глубь", сколько про "в ширь"
Not great not terrible as comrade Dyatlov might say. I believe this book needs a new edition, many of the things inside I find old concepts which not necessarily bring any value to readers trying to learn something about concurrency.
I liked the structure of the book however, this “Problem - Solution - Discusion” organization was very easy to read and skip parts if you dont feel you need to read.
Contains a lot of practical advice and code primers. Although if you expect a lot of descriptions and theory, or simply don't have any prior experience with TPL / dotnet concurrency in general, I'd suggest to look into other books which dive into theory first
Concise information with a lot of examples. Cleary put relevant information about async programming that was originally hard to find from Microsoft's docs alone.
Useful as a general review and a reference, but I ran out of steam trying to use all the examples in actual code. Good to go back to when handling a problem that requires a specific solution
A good way to come to grips with all the concurrency constructs in C#. This is a cookbook, so you take the ones you need. A good reference to have on one's shelf.
After reading this book I was able to write and follow concurrency in C#. I also know the landscape of concurrent of options available. That said I think this book serves better as a quick reference for more experienced developers than a learning resource.
Concurrency in C# Cookbook is a series of recipes, separated into 13 chapters, each beginning with some general discussion regarding the topic at hand. I needed to begin learning concurrency programming for work, and research led me to Stephen's book. While researching code smells surrounding poll-heavy while loops led me to the author's blog. Right away, I got some really good information and saw his book featured there. It's 208 pages of relevant, carefully guided material that has helped me to put together a plan for paying off some technical debt and dramatically reducing the memory footprint of some software running on our app servers. I highly recommend this book as both an introduction to concurrency programming in C# and also as a desktop reference book on various scenarios that you may encounter while working with concurrent code.
Quick, tidy reference of modern (no direct Thread/ThreadPool manipulation) approach to parallel, concurrent & async processing using C#. In a clean & structured form of short cookbook recipes. Doesn't dive deep, but presents you what you should know to start using particular lib / syntax. In my case it was a great refreshment after coming back from functional world (mainly on JVM) + I've finally read up something more about TPL DataFlow - the area I've somehow managed to skip until now.
To summarize: don't expect wonders, but if you just want an overview to actually start coding (there's no other way of learning how to write concurrent programs - reading is NOT ENOUGH), this book ain't a bad pick.
As a "cookbook", this book follows the pattern "problem/solution/discussion" showing how to solve problems related to concurrent code with minimal theory. So if you want to get deeper knowledge about its topics, this is NOT the book for you.
If you're working (or about to work) with concurrency, this book may help you with practical tips about async/wait, Parallel, Rx, immutable/thread-safe collections and the like. Even if you're not working with concurrency, it helps as a quick introduction to the basics of the topic.
its good to have it on shelf but its not worth it reading it as "normal" book. rather come back to it when you need advice, however prob. stack overflow would be able to help much faster and better. if you do not know anything about used technology and terminology, including frameworks.
The book is exactly what it says is: a cookbook. So don't expect detailed explanation of how things work behind the scenes, or too academic explanation. You should expect quick explanation of classes and features and how to use them and when.
This is by a long way the best book out there on multi threading task and other concurrent problems in C#. this is a reference that has been on my desk for a couple of years and help guide quite a few of my team to make better choices and get more out our systems.
Very useful book. Only good useful and actual information about all kind of modern .Net Concurrency, including .Net Core. Useful reciepts. Book will be good for beginners or non experts in concurrency. You don't find any deep diving here.
This book is somewhere between a coding cook book and an applied concept book. It goes into a decent amount of detail around the different approaches to concurrent programming with C#. It is not as in depth as an advance book but you will learn a lot from it despite its low page count.
Overall it's a very good book. I wish it had more and better examples instead of just excerpts. I also wish it had more theory behind, not just how to solve the issue.