Junior — Senior
Limit on the number of concurrently running goroutines
livecode
Task condition
The program receives a list of links and loads them in parallel using goroutines. When attempting to process a large set of addresses (for example, 100,000), problems may arise: due to the large number of goroutines running simultaneously, memory consumption increases, the scheduler load grows, and system resources (sockets, file descriptors) may be exhausted. To avoid these issues, it is necessary to limit the number of active goroutines at the same time, using semaphores, worker pools, or a limited channel.