Click here to Skip to main content
15,925,081 members
Home / Discussions / C#
   

C#

 
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 
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 
Hi,

adding threads may help as long as your job shows some remaining idle cycles,
provided the threads are not competing heavily for the same resources (CPU, memory
bandwidth, I/O bandwidth, ...).

In case of multiple pings, I expect there is some system limitation that will
make it impossible to have more than N outstanding pings, dont know what N would be tho.

Now if a succeeding ping needs a few seconds, and a failing ping times out in say
one minute, it would be bad design to split the ping destinations statically
(you might be unlucky and have all failing pings in the same thread, while the
other threads have long finished all the succesful pings, so threading did not help).

I would rather decide on a few threads, and let them fetch a ping target as soon
as they start or are idle again. So I would initially copy all targets to a list, and
(with lock) have the threads remove them one by one (so I'd use the list as a queue).

Smile | :)







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 
AnswerRe: Casting generic parameters to int Pin
mikker_1232-Jun-07 16:29
mikker_1232-Jun-07 16:29 
GeneralRe: Casting generic parameters to int Pin
Jack Valmadre2-Jun-07 17:27
Jack Valmadre2-Jun-07 17:27 
GeneralRe: Casting generic parameters to int Pin
Daniel Grunwald3-Jun-07 2:13
Daniel Grunwald3-Jun-07 2:13 
GeneralRe: Casting generic parameters to int Pin
mikker_1233-Jun-07 4:37
mikker_1233-Jun-07 4:37 
GeneralRe: Casting generic parameters to int Pin
Jack Valmadre3-Jun-07 10:34
Jack Valmadre3-Jun-07 10:34 

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.