The pattern I’ve used above should be fine. For something more elegant, see: Sum result of Threads.foreach() - #10 by tkf