add option to choose threads or processes