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
  • Worker pool — job queue + N workers

    Go SELF
    69 level,0 lecture
    We’ll break down why you might want to limit parallelism with a worker pool, how the “job queue → N workers → results channel” protocol works, who closes the jobs/ results channels and when they do close, and how to wire everything together with sync.WaitGroup. As an example, we’ll count words in task titles, show a diagram with Producer/ Collector, and go over typical causes of hangs and panic: close of closed channel.
    Open
  • Bounded concurrency: a semaphore via a buffered channel in Go 1.25

    Go SELF
    69 level,1 lecture
    We break down bounded concurrency in Go: how to limit the number of tasks running at the same time using a semaphore implemented with a buffered channel make(chan struct{}, N), where N is the in-flight limit. We discuss “tokens” ( acquire: sem <- struct{}{}, release: <- sem), the role of WaitGroup, where to do acquire (before go or inside), how a semaphore differs from a worker pool, and which mistakes most often lead to deadlocks and “slot” leaks.
    Open
  • Errors in parallel processing — “first” vs “all”

    Go SELF
    69 level,2 lecture
    We break down why, in concurrent Go code, you cannot just do return from a goroutine and “return the error to the outside,” and how to correctly deliver errors via channels and a single result contract ( Result). We compare the first-error and all-errors strategies, learn to build a full report using errors.Join, add context with fmt.Errorf and %w, and avoid deadlocks on early collector exit and when working with errCh.
    Open
  • Stop protocol: cancel-on-error and closing channels

    Go SELF
    69 level,3 lecture
    We break down why in concurrent setups you can’t “just do return”, how the stop protocol works via context.WithCancel and closing channels, who is allowed to call close, where hangs on send/receive most often happen, and how to implement cancel-on-error without goroutine leaks (double select with ctx.Done(), a coordinator with wg.Wait(), and a single close of results).
    Open
  • Backpressure and buffers — how not to “eat your memory”

    Go SELF
    69 level,4 lecture
    We break down why blocking on sending to a channel is not a bug, but a resilience mechanism: backpressure. We understand how cap(ch) turns into a “warehouse” of tasks/results, why large buffers can lead to OOM, and how to design bounded queues in a pipeline producer → workers → collector. In practice, we discuss choosing buffer sizes for jobs/ results, a “buffer of 1” for signals/errors, and common mistakes (huge buffers, attempts to manage concurrency via len(ch), leaks through references).
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
  • Game projects
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush