Setting MAXTHREADS dynamically.