added option to limit maximum amount of concurrent processes

Useful when running many tasks in parallel.