subsitute the producer/consumer framework to pool.map function