is there any way to limit how many threads can be created and let new threads wait until the running ones are finished? I tried this code: https://github.com/nim-lang/Nim/issues/19166but I got a Segmentation fault
In my experience using threads is least buggy with ARC (don't know about ORC), so maybe that might fix your segfault. Though that was always when using threadpool, not sure how this translates to system/threads.