Run a generator function in parallel N times for light-weight threading