Limit number of simultaneous threads