Click here to Skip to main content
15,895,462 members
Home / Discussions / C#
   

C#

 
GeneralRe: Simple array use, no looping = StackOverflowException? Pin
revi227-Jun-07 4:58
revi227-Jun-07 4:58 
AnswerRe: Simple array use, no looping = StackOverflowException? Pin
Christian Bailey7-Jun-07 10:30
Christian Bailey7-Jun-07 10:30 
QuestionThreadPool. Any way to know when all threads finished? Pin
Diego F.7-Jun-07 4:06
Diego F.7-Jun-07 4:06 
AnswerRe: ThreadPool. Any way to know when all threads finished? Pin
Dave Kreskowiak7-Jun-07 4:44
mveDave Kreskowiak7-Jun-07 4:44 
GeneralRe: ThreadPool. Any way to know when all threads finished? Pin
Diego F.7-Jun-07 4:52
Diego F.7-Jun-07 4:52 
AnswerRe: ThreadPool. Any way to know when all threads finished? Pin
Luc Pattyn7-Jun-07 4:50
sitebuilderLuc Pattyn7-Jun-07 4:50 
GeneralRe: ThreadPool. Any way to know when all threads finished? Pin
Diego F.7-Jun-07 4:56
Diego F.7-Jun-07 4:56 
GeneralRe: ThreadPool. Any way to know when all threads finished? Pin
Luc Pattyn7-Jun-07 5:13
sitebuilderLuc Pattyn7-Jun-07 5:13 
I am not sure:
- I have not used BackgroundWorker yet;
- I have limited experience with ThreadPool; IMHO it lacks some functionality.
- most often I use regular threads, so I can easily manage them (e.g. change their
priority).


Diego F. wrote:
when there are many threads?


what is many ?
It is my view that executing the same work in more than a couple of threads does
not improve performance: all these threads start to compete with one another
(they all want CPU cycles, or all want disk access, or...). So having 2 or 3 or 4
seems a maximum.
The one good reason I can come up with for really many similar threads is for
encapsulating independent jobs (as would be the case in a server with many clients).


BTW: when using real Threads, you can also do the following:
- for each new thread you create, add it to a list
remark: you probably want to set IsBackground true
- create a loop over that list, performing a Thread.Join();
when that loop finishes, all threads are done (does not matter in what order!).
advantage: no need to count
remark: clear the list when done
- you might even create an extra thread to run that loop, so it does the waitforall
logic, while your main thread can go on doing whatever it likes to do...

Hope this helps.

Smile | :)



GeneralRe: ThreadPool. Any way to know when all threads finished? Pin
Dave Kreskowiak7-Jun-07 5:28
mveDave Kreskowiak7-Jun-07 5:28 
QuestionPassword Permission Pin
Saiyed Alam7-Jun-07 3:54
Saiyed Alam7-Jun-07 3:54 
AnswerRe: Password Permission Pin
Dave Kreskowiak7-Jun-07 4:38
mveDave Kreskowiak7-Jun-07 4:38 
GeneralRe: Password Permission Pin
Dan Neely7-Jun-07 7:31
Dan Neely7-Jun-07 7:31 
GeneralRe: Password Permission Pin
Dave Kreskowiak7-Jun-07 8:21
mveDave Kreskowiak7-Jun-07 8:21 
AnswerRe: Password Permission Pin
Rick van Woudenberg7-Jun-07 5:02
Rick van Woudenberg7-Jun-07 5:02 
AnswerRe: Password Permission Pin
Dan Neely7-Jun-07 7:29
Dan Neely7-Jun-07 7:29 
QuestionDouble seperator disappears upon insert in DB Pin
Rick van Woudenberg7-Jun-07 3:37
Rick van Woudenberg7-Jun-07 3:37 
AnswerRe: Double seperator disappears upon insert in DB Pin
Ian Shlasko7-Jun-07 4:38
Ian Shlasko7-Jun-07 4:38 
GeneralRe: Double seperator disappears upon insert in DB Pin
Rick van Woudenberg7-Jun-07 5:26
Rick van Woudenberg7-Jun-07 5:26 
GeneralRe: Double seperator disappears upon insert in DB Pin
Ian Shlasko7-Jun-07 12:01
Ian Shlasko7-Jun-07 12:01 
GeneralRe: Double seperator disappears upon insert in DB Pin
Rick van Woudenberg8-Jun-07 13:07
Rick van Woudenberg8-Jun-07 13:07 
Question[Message Deleted] Pin
Ankit Aneja7-Jun-07 3:07
Ankit Aneja7-Jun-07 3:07 
AnswerRe: Filename.indexof Pin
Sathesh Sakthivel7-Jun-07 3:12
Sathesh Sakthivel7-Jun-07 3:12 
AnswerRe: Filename.indexof Pin
Anthony Surendran7-Jun-07 3:20
Anthony Surendran7-Jun-07 3:20 
QuestionCheck Box inside a datagrid in VS2003 Pin
Anthony Surendran7-Jun-07 2:38
Anthony Surendran7-Jun-07 2:38 
AnswerRe: Check Box inside a datagrid in VS2003 Pin
SimulationofSai7-Jun-07 3:26
SimulationofSai7-Jun-07 3:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.