You can add the option to exit the script when threads become 0
You can add the option to exit the script when threads become 0