Parallel Loop Anti-pattern

Here’s a quick parallel loop anti-pattern. In other words, don’t do this, it will only make you miserable. If you want to start tasks in a loop watch out for including the loop variable as a closure to the task body. For example: Task[] tasks = new Task[20]; for (int i = 0; i < […]