-
August 20th, 2008, 08:34 PM
#1
worker thread
i have created a visual C++ workspace and i uses worker thread method, what i want to ask is what is the maximum number of threads can it runs?
-
August 20th, 2008, 08:41 PM
#2
Re: worker thread
That's not a good question because it points to the fact that if you need that many threads, then you don't have a good design.
Since creating a thread requires a handle, one limit is the max # of handles available on the system. A while back (I think NT4 or Win2K) that used to be around 65K. Of course not all those would be available (because of other apps running, etc.).
You have a more practical limit of several thousand, but still that doesn't mean that using that many is a good design. Investigate thread pooling via QueueUserWorkItem api.
-
August 20th, 2008, 08:52 PM
#3
Re: worker thread
ok the program i have done total need of ten threads but when i put in the last thread coding in i have error when executing the program.
-
August 20th, 2008, 08:56 PM
#4
Re: worker thread
It's time to get out the undisputed king of troubleshooters.
That's right, pull out "the debugger."
Look for resources shared between threads that aren't synchronized.
-
August 20th, 2008, 09:00 PM
#5
Re: worker thread
i can try it but i dont know if i learn the solutions from there
-
August 20th, 2008, 11:03 PM
#6
Re: worker thread
Post the code from one of the thread procedures.
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
|