Limited number of threads at one time
I have a process that I run daily on a set of files. Each file can take up to a minute to go through the process. With 300 files, that can take up to like 12000000 minutes (or thereabouts). What I'd like to do is run several files at a time in different threads, but I don't want to bog down the machine that running the processes.
I'd like a way to keep a queue of maybe 10 threads max running, and as each thread ends, the next one in line is started in its place. Anyone ever come across anything of that nature.
I could probably come up with something myself, but I'm just too damn lazy. They say it happens in the autumn years, but I digress...
:afrog:
Re: Limited number of threads at one time
When you create a ThreadPool class, the default set for the thread limit is 25. 25 is close to 10 and is a nice number. And it also addresses your issue.
I do not know how to change it to 10.