thread based sums