Sobes.tech
Junior — Senior

Concurrent task execution with error limit

livecode

Task condition

It is necessary to write a function that distributes the execution of given tasks across n goroutines, regardless of the total number of tasks. The process should be terminated as soon as the number of errors exceeds the threshold m, and there should be no remaining active goroutines. If the number of errors does not exceed m, all tasks should be completed fully.