limit number of threads to hard-coded maximum