Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Enterprise Application Development with C# 10 and .NET 6

You're reading from   Enterprise Application Development with C# 10 and .NET 6 Become a professional .NET developer by learning expert techniques for building scalable applications

Arrow left icon
Product type Paperback
Published in Jun 2022
Publisher Packt
ISBN-13 9781803232973
Length 586 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (4):
Arrow left icon
Ravindra Akella Ravindra Akella
Author Profile Icon Ravindra Akella
Ravindra Akella
Arun Kumar Tamirisa Arun Kumar Tamirisa
Author Profile Icon Arun Kumar Tamirisa
Arun Kumar Tamirisa
 Kumar Kunani Kumar Kunani
Author Profile Icon Kumar Kunani
Kumar Kunani
Bhupesh Guptha Muthiyalu Bhupesh Guptha Muthiyalu
Author Profile Icon Bhupesh Guptha Muthiyalu
Bhupesh Guptha Muthiyalu
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Part 1: Fundamentals
2. Chapter 1: Designing and Architecting the Enterprise Application FREE CHAPTER 3. Chapter 2: Introducing .NET 6 Core and Standard 4. Chapter 3: Introducing C# 10 5. Part 2: Cross-Cutting Concerns
6. Chapter 4: Threading and Asynchronous Operations 7. Chapter 5: Dependency Injection in .NET 6 8. Chapter 6: Configuration in .NET 6 9. Chapter 7: Logging in .NET 6 10. Chapter 8: All You Need to Know about Caching 11. Part 3: Developing Enterprise Applications
12. Chapter 9: Working with Data in .NET 6 13. Chapter 10: Creating an ASP.NET Core 6 Web API 14. Chapter 11: Creating an ASP.NET Core 6 Web Application 15. Part 4: Security
16. Chapter 12: Understanding Authentication 17. Chapter 13: Implementing Authorization in .NET 6 18. Part 5: Health Checks, Unit Testing, Deployment, and Diagnostics
19. Chapter 14: Health and Diagnostics 20. Chapter 15: Testing 21. Chapter 16: Deploying the Application in Azure 22. Other Books You May Enjoy

Using concurrent collections for parallelism

Collections classes are one of the most used types to encapsulate, retrieve, and modify enumerated sets of related data. Dictionary, list, queue, and array are some of the frequently used collection types, but they are not thread-safe. These collections are good if you access them from just one thread at a time.

A real-world environment would be multithreaded, and to make it thread-safe, you will have to implement various synchronization constructs, as described in an earlier section. To solve this problem, Microsoft came up with concurrent collection classes, such as ConcurrentQueue, ConcurrentBag, ConcurrentDictionary, and ConcurrentStack, which are thread-safe, as they internally implement synchronization. Let's look at them in detail in the following sections.

ConcurrentDictionary

Let's stimulate a multithreaded environment using a dictionary. Consider the t1 task as one operation from a client who is adding to the...

lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Enterprise Application Development with C# 10 and .NET 6
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon