Click here to Skip to main content
15,914,924 members
Home / Discussions / C#
   

C#

 
AnswerRe: Image in XML file Pin
Dave Kreskowiak5-Nov-08 15:13
mveDave Kreskowiak5-Nov-08 15:13 
AnswerRe: Image in XML file Pin
Mirko19805-Nov-08 22:07
Mirko19805-Nov-08 22:07 
QuestionSQL Server Express - How many querys per a second can it handle? Pin
Brad Wick5-Nov-08 12:52
Brad Wick5-Nov-08 12:52 
AnswerRe: SQL Server Express - How many querys per a second can it handle? Pin
Ashfield5-Nov-08 21:16
Ashfield5-Nov-08 21:16 
QuestionNot Getting Data Back From Stored Proc Call Pin
Kevin Marois5-Nov-08 10:28
professionalKevin Marois5-Nov-08 10:28 
AnswerRe: Not Getting Data Back From Stored Proc Call Pin
KaptinKrunch5-Nov-08 10:42
KaptinKrunch5-Nov-08 10:42 
AnswerRe: Not Getting Data Back From Stored Proc Call Pin
Ashfield5-Nov-08 21:26
Ashfield5-Nov-08 21:26 
Questionwaiting for multiple threads Pin
invictus35-Nov-08 10:24
invictus35-Nov-08 10:24 
Hi
I have a project where I want to start X threads for processing in the background while the main thread does other stuff. However, as soon as the main thread is finished with its work it should wait for all the other threads to finish before continue.

I looked at threadpool and found it to be insufficient (due to reasons I will not discuss here).

What I try instead is to implement my own pool of threads starting with:

Thread[] threads = new Thread[numthreads];
for (int i = 0; i < this.threads.Length; i++)
{
threads[i] = new Thread(Handler);
threads[i].Start();
}


I figured I could use ManualResetEvent to wait for the threads to finish. My question is this though:

Can I use a single resetevent for all threads to signal, or do I really need to have <numthreads> resetevents and use WaitHandle.WaitAll()?


How about the other way around? Can I have a single resetevent that all threads are listening to (waiting for input to process), and then only the first thread to catch the signal from the mainthread to actually start processing?
AnswerRe: waiting for multiple threads Pin
Nicholas Butler5-Nov-08 11:35
sitebuilderNicholas Butler5-Nov-08 11:35 
QuestionAccessing a static variable Pin
Member 41431915-Nov-08 8:46
Member 41431915-Nov-08 8:46 
AnswerRe: Accessing a static variable Pin
User 66585-Nov-08 9:41
User 66585-Nov-08 9:41 
GeneralRe: Accessing a static variable Pin
Member 41431915-Nov-08 10:25
Member 41431915-Nov-08 10:25 
QuestionHow to compare custom objects in a Dictionary&lt;&gt; Pin
ret76795-Nov-08 8:24
ret76795-Nov-08 8:24 
AnswerRe: How to compare custom objects in a Dictionary&lt;&gt; Pin
User 66585-Nov-08 9:50
User 66585-Nov-08 9:50 
GeneralRe: How to compare custom objects in a Dictionary&lt;&gt; Pin
ret76796-Nov-08 5:27
ret76796-Nov-08 5:27 
GeneralRe: How to compare custom objects in a Dictionary&lt;&gt; Pin
User 66586-Nov-08 10:25
User 66586-Nov-08 10:25 
Questiondeleting data from a database Pin
postonoh5-Nov-08 7:25
postonoh5-Nov-08 7:25 
QuestionRe: deleting data from a database Pin
Le centriste5-Nov-08 8:33
Le centriste5-Nov-08 8:33 
GeneralRe: deleting data from a database Pin
Guffa5-Nov-08 9:17
Guffa5-Nov-08 9:17 
GeneralRe: deleting data from a database Pin
Le centriste5-Nov-08 9:35
Le centriste5-Nov-08 9:35 
AnswerRe: deleting data from a database Pin
Guffa5-Nov-08 9:37
Guffa5-Nov-08 9:37 
GeneralRe: deleting data from a database Pin
postonoh5-Nov-08 9:42
postonoh5-Nov-08 9:42 
QuestionGetting application Icon Pin
Dirso5-Nov-08 7:16
Dirso5-Nov-08 7:16 
AnswerRe: Getting application Icon Pin
Colin Angus Mackay5-Nov-08 7:22
Colin Angus Mackay5-Nov-08 7:22 
GeneralRe: Getting application Icon Pin
Dirso5-Nov-08 7:35
Dirso5-Nov-08 7:35 

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.