Here is a simple patch that may help to improve the performance of MapReduce when shutting down a thread pool. Rather than releasing a new version of PS5, we are just providing this patch--you should make this modification in your code directly. In the function destroy: pool -> unit in the file shared/thread_pool.ml, insert the line     Queue.clear q; between the two lines     Mutex.lock m;     let n = !nworkers in