taskFactory is separate for each thread