Making c/map_reduce threaded