global hash aggregation with atomic add and pthread mutex