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

C#

 
QuestionHOW TO MAKE VALIDATION IN WINDOS APPLICATION Pin
ashraf hakiem2-Jun-07 22:01
ashraf hakiem2-Jun-07 22:01 
AnswerRe: HOW TO MAKE VALIDATION IN WINDOS APPLICATION Pin
WillemM2-Jun-07 22:08
WillemM2-Jun-07 22:08 
GeneralRe: HOW TO MAKE VALIDATION IN WINDOS APPLICATION Pin
ashraf hakiem2-Jun-07 22:16
ashraf hakiem2-Jun-07 22:16 
GeneralRe: HOW TO MAKE VALIDATION IN WINDOS APPLICATION Pin
Christian Graus3-Jun-07 1:23
protectorChristian Graus3-Jun-07 1:23 
GeneralRe: HOW TO MAKE VALIDATION IN WINDOS APPLICATION Pin
WillemM3-Jun-07 4:30
WillemM3-Jun-07 4:30 
QuestionPermutations/Combinations Pin
Expert Coming2-Jun-07 20:41
Expert Coming2-Jun-07 20:41 
AnswerRe: Permutations/Combinations Pin
Luc Pattyn3-Jun-07 2:06
sitebuilderLuc Pattyn3-Jun-07 2:06 
QuestionHow to split work into multiple threads. Pin
kripzz2-Jun-07 19:50
kripzz2-Jun-07 19:50 
I have a list view which contains 100 items. For each item i need to do some work on it which takes a long time. I want to create (100 / 4) threads so i can split the work.

Lets assume my original code is

for(int i = 0; i < listview1.Items.Count; i++)<br />
{<br />
doStuff(listview1.Items[i].Subitems[1].Text);<br />
listview1.Items[i].Subitems[2].Text = "blah";<br />
}


Thread[] threads = new Thread[100/4];

Now how to split the work for each thread?

Thread 0:

for(int i = 0; i < 4; i++)<br />
{<br />
doStuff(listview1.Items[i].Subitems[1].Text);<br />
listview1.Items[i].Subitems[2].Text = "blah";<br />
}


Thread 1:

for(int i = 4; i < 8; i++)<br />
{<br />
doStuff(listview1.Items[i].Subitems[1].Text);<br />
listview1.Items[i].Subitems[2].Text = "blah";<br />
}


and so on.
AnswerRe: How to split work into multiple threads. Pin
Expert Coming2-Jun-07 20:14
Expert Coming2-Jun-07 20:14 
GeneralRe: How to split work into multiple threads. Pin
kripzz2-Jun-07 20:25
kripzz2-Jun-07 20:25 
GeneralRe: How to split work into multiple threads. Pin
Expert Coming2-Jun-07 20:29
Expert Coming2-Jun-07 20:29 
AnswerRe: How to split work into multiple threads. Pin
Christian Graus2-Jun-07 20:32
protectorChristian Graus2-Jun-07 20:32 
AnswerRe: How to split work into multiple threads. Pin
Luc Pattyn3-Jun-07 2:34
sitebuilderLuc Pattyn3-Jun-07 2:34 
AnswerRe: How to split work into multiple threads. Pin
Robert Rohde3-Jun-07 2:57
Robert Rohde3-Jun-07 2:57 
GeneralRe: How to split work into multiple threads. Pin
kripzz11-Jun-07 16:39
kripzz11-Jun-07 16:39 
AnswerRe: How to split work into multiple threads. Pin
Hesham Yassin6-Jun-07 8:32
Hesham Yassin6-Jun-07 8:32 
QuestionHmmm why won't this work? Pin
mfkr2-Jun-07 17:58
mfkr2-Jun-07 17:58 
AnswerRe: Hmmm why won't this work? Pin
Christian Graus2-Jun-07 19:07
protectorChristian Graus2-Jun-07 19:07 
GeneralRe: Hmmm why won't this work? Pin
mfkr2-Jun-07 19:17
mfkr2-Jun-07 19:17 
GeneralRe: Hmmm why won't this work? Pin
Christian Graus2-Jun-07 19:22
protectorChristian Graus2-Jun-07 19:22 
AnswerRe: Hmmm why won't this work? Pin
Robert Surtees2-Jun-07 19:24
Robert Surtees2-Jun-07 19:24 
GeneralRe: Hmmm why won't this work? Pin
mfkr2-Jun-07 19:32
mfkr2-Jun-07 19:32 
GeneralRe: Hmmm why won't this work? Pin
Christian Graus2-Jun-07 20:33
protectorChristian Graus2-Jun-07 20:33 
GeneralRe: Hmmm why won't this work? Pin
Dave Kreskowiak3-Jun-07 5:07
mveDave Kreskowiak3-Jun-07 5:07 
QuestionCasting generic parameters to int Pin
Jack Valmadre2-Jun-07 15:19
Jack Valmadre2-Jun-07 15:19 

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.