Book description
Over 70 recipes to get you writing powerful and efficient multithreaded, asynchronous, and parallel programs in C# 6.0
About This Book
Rewritten and updated to take advantage of the latest C# 6 features
Learn about multithreaded, asynchronous, and parallel programming through hands-on, code-first examples
Use these recipes to build fast, scalable, and reliable applications in C#
Who This Book Is For
This book is aimed at those who are new to multithreaded programming, and who are looking for a quick and easy way to get started. It is assumed that you have some experience in C# and .NET already, and you should also be familiar with basic computer science terminology and basic algorithms and data structures.
What You Will Learn
Use C# 6.0 asynchronous language features
Work with raw threads, synchronize threads, and coordinate their work
Develop your own asynchronous API with Task Parallel Library
Work effectively with a thread pool
Scale up your server application with I/O threads
Parallelize your LINQ queries with PLINQ
Use common concurrent collections
Apply different parallel programming patterns
Use Reactive Extensions to run asynchronous operations and manage their options
In Detail
Multi-core processors are synonymous with computing speed and power in today’s world, which is why multithreading has become a key concern for C# developers. Multithreaded code helps you create effective, scalable, and responsive applications.
This is an easy-to-follow guide that will show you difficult programming problems in context. You will learn how to solve them with practical, hands-on, recipes. With these recipes, you’ll be able to start creating your own scalable and reliable multithreaded applications. Starting from learning what a thread is, we guide you through the basics and then move on to more advanced concepts such as task parallel libraries, C# asynchronous functions, and much more.
Rewritten to the latest C# specification, C# 6, and updated with new and modern recipes to help you make the most of the hardware you have available, this book will help you push the boundaries of what you thought possible in C#.
Style and approach
This is an easy-to-follow guide full of hands-on examples of real-world multithreading tasks. Each topic is explained and placed in context, and for the more inquisitive, there are also more in-depth details of the concepts used.
Table of contents
-
Multithreading with C# Cookbook Second Edition
- Table of Contents
- Multithreading with C# Cookbook Second Edition
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. Threading Basics
-
2. Thread Synchronization
- Introduction
- Performing basic atomic operations
- Using the Mutex construct
- Using the SemaphoreSlim construct
- Using the AutoResetEvent construct
- Using the ManualResetEventSlim construct
- Using the CountDownEvent construct
- Using the Barrier construct
- Using the ReaderWriterLockSlim construct
- Using the SpinWait construct
- 3. Using a Thread Pool
- 4. Using the Task Parallel Library
-
5. Using C# 6.0
- Introduction
- Using the await operator to get asynchronous task results
- Using the await operator in a lambda expression
- Using the await operator with consequent asynchronous tasks
- Using the await operator for the execution of parallel asynchronous tasks
- Handling exceptions in asynchronous operations
- Avoiding the use of the captured synchronization context
- Working around the async void method
- Designing a custom awaitable type
- Using the dynamic type with await
- 6. Using Concurrent Collections
- 7. Using PLINQ
- 8. Reactive Extensions
- 9. Using Asynchronous I/O
- 10. Parallel Programming Patterns
- 11. There's More
- Index
Product information
- Title: Multithreading with C# Cookbook - Second Edition
- Author(s):
- Release date: April 2016
- Publisher(s): Packt Publishing
- ISBN: 9781785881251
You might also like
book
Hands-On Parallel Programming with C# 8 and .NET Core 3
Enhance your enterprise application development skills by mastering parallel programming techniques in .NET and C# Key …
video
Hands-On Parallel Programming with C# 8 and .NET Core 3.0
With the new industry standard of increasing the processing power of machines, the concept of parallel …
book
Hands-On Object-Oriented Programming with C#
Enhance your programming skills by learning the intricacies of object oriented programming in C# 8 Key …
book
Design Patterns in .NET Core 3: Reusable Approaches in C# and F# for Object-Oriented Software Design
Implement design patterns in .NET Core 3 using the latest versions of the C# and F# …