Worker: Added option for maximum threads that are started; changed handling of thread negotiation from random numbers to job pids and considering the started threads