Click here to Skip to main content
15,896,207 members
Home / Discussions / C#
   

C#

 
AnswerRe: Parallel.For Issue Pin
Luc Pattyn6-Apr-11 5:25
sitebuilderLuc Pattyn6-Apr-11 5:25 
GeneralRe: Parallel.For Issue Pin
Bassam Abdul-Baki6-Apr-11 5:29
professionalBassam Abdul-Baki6-Apr-11 5:29 
GeneralRe: Parallel.For Issue Pin
David19876-Apr-11 5:31
David19876-Apr-11 5:31 
GeneralRe: Parallel.For Issue Pin
Luc Pattyn6-Apr-11 6:32
sitebuilderLuc Pattyn6-Apr-11 6:32 
GeneralRe: Parallel.For Issue Pin
BobJanova6-Apr-11 6:31
BobJanova6-Apr-11 6:31 
GeneralRe: Parallel.For Issue Pin
AspDotNetDev6-Apr-11 7:07
protectorAspDotNetDev6-Apr-11 7:07 
GeneralRe: Parallel.For Issue Pin
Bassam Abdul-Baki6-Apr-11 14:13
professionalBassam Abdul-Baki6-Apr-11 14:13 
GeneralRe: Parallel.For Issue Pin
Luc Pattyn6-Apr-11 5:24
sitebuilderLuc Pattyn6-Apr-11 5:24 
if your loop iterations have data dependencies (e.g. you are trying to calculate the overall sum in one accumulator), then parallellized code would require synchronization, which could throw away most if not all of your potential performance gains.

The normal way to efficiently calculate an overall sum would be to have explicit threads, each thread holding its own accumulator, summing the data entrusted on it; then in a sequential way adding all accumulators together.

As always, simple solutions only work well in simple situations...

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

GeneralRe: Parallel.For Issue Pin
Bassam Abdul-Baki6-Apr-11 5:27
professionalBassam Abdul-Baki6-Apr-11 5:27 
AnswerRe: Parallel.For Issue Pin
Luc Pattyn6-Apr-11 5:36
sitebuilderLuc Pattyn6-Apr-11 5:36 
GeneralRe: Parallel.For Issue Pin
Bassam Abdul-Baki6-Apr-11 5:40
professionalBassam Abdul-Baki6-Apr-11 5:40 
GeneralRe: Parallel.For Issue Pin
Mirko19806-Apr-11 10:21
Mirko19806-Apr-11 10:21 
GeneralRe: Parallel.For Issue Pin
Bassam Abdul-Baki6-Apr-11 14:14
professionalBassam Abdul-Baki6-Apr-11 14:14 
QuestionRundom function Pin
treuveni6-Apr-11 4:48
treuveni6-Apr-11 4:48 
AnswerRe: Rundom function Pin
PIEBALDconsult6-Apr-11 4:53
mvePIEBALDconsult6-Apr-11 4:53 
GeneralRe: Rundom function Pin
Thomas Krojer6-Apr-11 4:54
Thomas Krojer6-Apr-11 4:54 
GeneralRe: Rundom function Pin
PIEBALDconsult6-Apr-11 4:57
mvePIEBALDconsult6-Apr-11 4:57 
GeneralRe: Rundom function Pin
Luc Pattyn6-Apr-11 5:28
sitebuilderLuc Pattyn6-Apr-11 5:28 
AnswerRe: Rundom function Pin
Pete O'Hanlon6-Apr-11 4:53
mvePete O'Hanlon6-Apr-11 4:53 
GeneralRe: Rundom function Pin
treuveni6-Apr-11 5:13
treuveni6-Apr-11 5:13 
GeneralRe: Rundom function Pin
Pete O'Hanlon6-Apr-11 5:16
mvePete O'Hanlon6-Apr-11 5:16 
GeneralRe: Rundom function Pin
riced6-Apr-11 5:21
riced6-Apr-11 5:21 
GeneralRe: Rundom function Pin
#realJSOP6-Apr-11 5:45
professional#realJSOP6-Apr-11 5:45 
GeneralRe: Rundom function Pin
treuveni6-Apr-11 6:21
treuveni6-Apr-11 6:21 
JokeRe: Rundom function Pin
Bernhard Hiller6-Apr-11 20:27
Bernhard Hiller6-Apr-11 20:27 

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.