# Method Thread.Farm()->set_max_num_threads()

Method set_max_num_threads

  `int set_max_num_threads(int(1..) to)`

Description

  Set the maximum number of worker threads that the thread farm may have.

Parameter `to`

  The new maximum number.

  If there are more worker threads than to, the function will wait until enough threads have finished, so that the total is to or less.

  The default maximum number of worker threads is `20`.