reduce in ThreadWorker