Should there be a limit to the number of threads sshreader can spawn?

Issue #7 resolved
Jesse Almanrode repo owner created an issue

Right now, sshreader is allowed to spawn as many threads as their are ServerJob objects (per process) or a specific number specified at the call of sshreader.sshread() (not to exceed the number of jobs). Should there be a limit to this number? Essentially if a user asks for 1000 jobs, they will spawn 1000 threads (if tcount is set to 0). With the maximum number of jobs allowed by sshreader at 1,000,000 then the user could end up accidentally spawning that many threads as well.

What I would propose is that each process is not allowed to spawn more than say 500 threads (which is still a lot) when tcount is set to 0.

Comments (3)

  1. Jesse Almanrode reporter

    I have implemented a thread limit when using pcount and tcount in conjunction and when pcount <=0 and tcount == 0. If you manually specify more threads than 500 you will be allowed to do so. This is just a protection when you are letting sshreader calculate how many threads to spawn on each subprocess.

    Commit ac0c413

  2. Log in to comment