|
-
Sep 21st, 2011, 05:52 AM
#5
Thread Starter
Hyperactive Member
Re: how to stop threads ?
 Originally Posted by jmcilhinney
You've only got one variable so you only have one Thread reference so you can only Abort one thread. If you want to abort every thread then you need a reference to every Thread object. That means either an individual variable for each one or an array or collection containing them all.
That said, you really shouldn't be starting that many threads explicitly. With that many tasks to run you should be using the ThreadPool, either directly or indirectly.
I tested this with 1000 and it ran fine with no lagg and no high mem or cpu usage and runs pretty damm fast, but i have limited it to 200 max. But yes its only 1 thread that runs multiple times as thats all thats needed.
Thanks
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
|