That's pretty much it -- I can increase memory, file descriptor, etc., but can I increase the number of threads?
(I've got a case where, in an error condition, my threads block [still trying to figure out why] and new ones are still being generated, until I hit a limit of 512 threads.)
can I increase the number of threads?
No [1].
That limit is very high, and if you’re hitting it then the correct path forward is to investigate why you’re hitting it, not to try to raise it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Well, it is, as always, complex, but the 512 limit is likely to be the maximum number of work queue threads, and that’s not something you can adjust [2].
[2] Well, it is, as always, complex, because you can adjust this using the kern.wq_max_threads
sysctl, but that’s a system-wide setting, not a per-process setting.