JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Introduction to Concurrent collections

    C# SELF
    58 level,0 lecture
    In this lecture we'll go over why regular collections like List<T> and Dictionary<TKey, TValue> break under multithreading (race conditions), why a single lock is often not enough, and how the thread-safe collections from System.Collections.Concurrent solve these problems. We'll look at the key structures: ConcurrentQueue<T>, ConcurrentStack<T>, ConcurrentBag<T>, ConcurrentDictionary<TKey, TValue>, their scenarios (producer–consumer, caching, object pools) and how to choose between them.
    Open
  • Queues and Stacks Producer-Consumer

    C# SELF
    58 level,1 lecture
    We break down the Producer-Consumer pattern using .NET thread-safe collections: ConcurrentQueue<T> (FIFO) and ConcurrentStack<T> (LIFO). You'll see how to use Enqueue()/ TryDequeue() and Push()/ TryPop(), why operation atomicity matters, how to build a multithreaded pipeline and organize an object pool. At the end — a comparison of use cases to choose the right structure.
    Open
  • ConcurrentBag and ConcurrentDictionary

    C# SELF
    58 level,2 lecture
    Let's break down two key thread-safe .NET collections: ConcurrentBag — a fast "bag" with no ordering guarantees optimized for thread-local access, and ConcurrentDictionary — a high-performance dictionary with atomic operations ( TryAdd, TryUpdate, GetOrAdd, AddOrUpdate). We'll talk about internal principles, typical scenarios, and practical examples.
    Open
  • Advanced patterns and nuances of Concurrent collections

    C# SELF
    58 level,3 lecture
    We dig into multithreaded patterns based on Concurrent collections: implementing the "Producer–Consumer" with ConcurrentQueue and BlockingCollection<T>, correct shutdown signaling via CancellationTokenSource, and important subtleties of the Count/ IsEmpty properties, the ToArray() method and iteration to write reliable and predictable code.
    Open
  • Thread-safety patterns

    C# SELF
    58 level,4 lecture
    We break down how lock-free and wait-free algorithms work, why collections in the System.Collections.Concurrent namespace scale better than regular ones using a lock, and how the .NET runtime relies on atomic operations via System.Threading.Interlocked and CAS ( CompareExchange). We'll look at performance, the impact of contention, take a quick peek under the hood of ConcurrentQueue<T>, pick the right collection for the job, and discuss practical optimization tips ( ToArray(), Count, batching operations).
    Open
Courses
  • Java Course
  • Python Course
  • Development with Claude Code
  • All 16 courses
University
  • Java FullStack
  • Python FullStack
  • AI Native Developer
  • Web FullStack
Community
  • Articles
  • Forum
  • Help with Tasks
Company
  • About us
  • Contacts
  • Reviews
  • Pricing
  • Questions and answers
JavaRush JavaRush: online courses in Java and other programming languages, where you learn by solving tasks. We started in 2012 with a Java course, and today there are 16 courses: Java and Spring, Python, web development, SQL, Go, C#, C++, Kotlin, Swift, Docker and AI development. More than 10,000 tasks with instant checks, and the first level of any course is free. Learn on your own or with a mentor at JavaRush University.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy
MastercardVisa
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy