Click here to Skip to main content
15,880,905 members
Home / Discussions / C#
   

C#

 
Questioncall web API in c# Pin
Member 1212120116-Nov-15 18:15
Member 1212120116-Nov-15 18:15 
QuestionRe: call web API in c# Pin
PANKAJMAURYA16-Nov-15 18:31
professionalPANKAJMAURYA16-Nov-15 18:31 
AnswerRe: call web API in c# Pin
OriginalGriff16-Nov-15 20:20
mveOriginalGriff16-Nov-15 20:20 
AnswerRe: call web API in c# Pin
Pete O'Hanlon16-Nov-15 21:22
mvePete O'Hanlon16-Nov-15 21:22 
QuestionHow to improve Parallel.For loading speed? Pin
smallkubi16-Nov-15 13:46
smallkubi16-Nov-15 13:46 
AnswerRe: How to improve Parallel.For loading speed? Pin
Richard Deeming17-Nov-15 4:48
mveRichard Deeming17-Nov-15 4:48 
GeneralRe: How to improve Parallel.For loading speed? Pin
smallkubi17-Nov-15 13:43
smallkubi17-Nov-15 13:43 
GeneralRe: How to improve Parallel.For loading speed? Pin
Simon_Whale18-Nov-15 1:26
Simon_Whale18-Nov-15 1:26 
I am hoping that the code you have given is not the true code that you are trying to improve.

But from this

How to: Write a Simple Parallel.For loop[^]

Quote:
When parallelizing any code, including loops, one important goal is to utilize the processors as much as possible without over parallelizing to the point where the overhead for parallel processing negates any performance benefits. In this particular example, only the outer loop is parallelized because there is not very much work performed in the inner loop. The combination of a small amount of work and undesirable cache effects can result in performance degradation in nested parallel loops. Therefore, parallelizing the outer loop only is the best way to maximize the benefits of concurrency on most systems.


One of the first things I always try to do when using Parallel loops is to limit the amount of processors that it could use with the following

MaxDegreeOfParallelism[^] option.

e.g.

C#
ConcurrentBag list = new ConcurrentBag();
ParallelOptions options= new ParallelOptions { MaxDegreeOfParallelism = 2 };
Parallel.For(0,10000, options, item => 
{
 list.Add(item);
}

Every day, thousands of innocent plants are killed by vegetarians.

Help end the violence EAT BACON

Questionbest explanation of using C# 'virtual, or 'abstract methods ... for beginners in the language Pin
BillWoodruff16-Nov-15 3:58
professionalBillWoodruff16-Nov-15 3:58 
AnswerRe: best explanation of creating a C# class as 'virtual, or 'abstract ... for beginners in the language Pin
OriginalGriff16-Nov-15 4:04
mveOriginalGriff16-Nov-15 4:04 
GeneralRe: best explanation of creating a C# class as 'virtual, or 'abstract ... for beginners in the language Pin
BillWoodruff16-Nov-15 4:20
professionalBillWoodruff16-Nov-15 4:20 
AnswerRe: best explanation of using C# 'virtual, or 'abstract methods ... for beginners in the language Pin
Simon_Whale16-Nov-15 4:40
Simon_Whale16-Nov-15 4:40 
GeneralRe: best explanation of using C# 'virtual, or 'abstract methods ... for beginners in the language Pin
BillWoodruff18-Nov-15 0:33
professionalBillWoodruff18-Nov-15 0:33 
AnswerRe: best explanation of using C# 'virtual, or 'abstract methods ... for beginners in the language Pin
Pete O'Hanlon16-Nov-15 5:38
mvePete O'Hanlon16-Nov-15 5:38 
GeneralRe: best explanation of using C# 'virtual, or 'abstract methods ... for beginners in the language Pin
BillWoodruff18-Nov-15 0:34
professionalBillWoodruff18-Nov-15 0:34 
AnswerRe: best explanation of using C# 'virtual, or 'abstract methods ... for beginners in the language Pin
OriginalGriff16-Nov-15 5:42
mveOriginalGriff16-Nov-15 5:42 
AnswerRe: best explanation of using C# 'virtual, or 'abstract methods ... for beginners in the language Pin
Gerry Schmitz16-Nov-15 18:28
mveGerry Schmitz16-Nov-15 18:28 
QuestionHow can I fill a Combobox while writing? Pin
Member 1191673515-Nov-15 23:56
Member 1191673515-Nov-15 23:56 
AnswerMessage Closed Pin
16-Nov-15 0:09
professionalPANKAJMAURYA16-Nov-15 0:09 
GeneralRe: How can I fill a Combobox while writing? Pin
John Torjo16-Nov-15 0:18
professionalJohn Torjo16-Nov-15 0:18 
AnswerRe: How can I fill a Combobox while writing? Pin
John Torjo16-Nov-15 0:16
professionalJohn Torjo16-Nov-15 0:16 
GeneralRe: How can I fill a Combobox while writing? Pin
Member 1191673518-Nov-15 1:47
Member 1191673518-Nov-15 1:47 
GeneralRe: How can I fill a Combobox while writing? Pin
John Torjo18-Nov-15 2:10
professionalJohn Torjo18-Nov-15 2:10 
AnswerRe: How can I fill a Combobox while writing? Pin
PANKAJMAURYA16-Nov-15 0:25
professionalPANKAJMAURYA16-Nov-15 0:25 
GeneralRe: How can I fill a Combobox while writing? Pin
Member 1191673518-Nov-15 2:08
Member 1191673518-Nov-15 2:08 

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.