|
-
Nov 4th, 2005, 07:52 AM
#1
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...
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 4th, 2005, 09:33 AM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|