Added setting to select threading vs multiprocessing