Managing max number of concurrent threads

Adding a way of managing max number of concurrent threads.