Click here to Skip to main content
15,569,696 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: .net 6.0 web api how increment request timeout? Pin
Richard Deeming25-Oct-22 2:48
mveRichard Deeming25-Oct-22 2:48 
QuestionWays to migrate a Silverlight application? Pin
Member 1579410912-Oct-22 23:54
Member 1579410912-Oct-22 23:54 
AnswerRe: Ways to migrate a Silverlight application? Pin
Richard Deeming13-Oct-22 0:27
mveRichard Deeming13-Oct-22 0:27 
Questioncsv file sort and create a new and store the data Pin
Member 1577533021-Sep-22 21:52
Member 1577533021-Sep-22 21:52 
AnswerRe: csv file sort and create a new and store the data Pin
Richard Deeming21-Sep-22 22:31
mveRichard Deeming21-Sep-22 22:31 
QuestionPLINQ - WithDegreeOfParallelism Pin
dataminers9-Sep-22 6:27
dataminers9-Sep-22 6:27 
AnswerRe: PLINQ - WithDegreeOfParallelism Pin
Richard MacCutchan9-Sep-22 6:50
mveRichard MacCutchan9-Sep-22 6:50 
GeneralRe: PLINQ - WithDegreeOfParallelism Pin
dataminers9-Sep-22 11:18
dataminers9-Sep-22 11:18 
Dear Richard, thank you for your reply.

I understand that based on your answer, the two code blocks below are the same;

C#
await Task.Run(() =>
{
    CalculateSomething(5);
});

await Task.Run(() =>
{
    CalculateSomething(8);
});


C#
List<int> myList = new() { 5, 8 };

myList.AsParallel().WithDegreeOfParallelism(2).ForAll(x =>
{
    CalculateSomething(x);
});



Both complete the process on two Threads.

Note: CalculateSomething hypothetically this function takes a very long time

Regards...

modified 9-Sep-22 17:15pm.

GeneralRe: PLINQ - WithDegreeOfParallelism Pin
Richard MacCutchan9-Sep-22 22:53
mveRichard MacCutchan9-Sep-22 22:53 
GeneralRe: PLINQ - WithDegreeOfParallelism Pin
dataminers11-Sep-22 3:01
dataminers11-Sep-22 3:01 
GeneralRe: PLINQ - WithDegreeOfParallelism Pin
Dave Kreskowiak11-Sep-22 5:36
mveDave Kreskowiak11-Sep-22 5:36 
GeneralRe: PLINQ - WithDegreeOfParallelism Pin
Richard Deeming11-Sep-22 22:39
mveRichard Deeming11-Sep-22 22:39 
QuestionMultiThread on Single Core Processor (CPU) Pin
dataminers6-Sep-22 4:24
dataminers6-Sep-22 4:24 
AnswerRe: MultiThread on Single Core Processor (CPU) Pin
dan!sh 6-Sep-22 4:46
professional dan!sh 6-Sep-22 4:46 
GeneralRe: MultiThread on Single Core Processor (CPU) Pin
dataminers6-Sep-22 23:28
dataminers6-Sep-22 23:28 
AnswerRe: MultiThread on Single Core Processor (CPU) Pin
Eddy Vluggen6-Sep-22 5:20
professionalEddy Vluggen6-Sep-22 5:20 
AnswerRe: MultiThread on Single Core Processor (CPU) Pin
Dave Kreskowiak6-Sep-22 5:38
mveDave Kreskowiak6-Sep-22 5:38 
GeneralRe: MultiThread on Single Core Processor (CPU) Pin
Eddy Vluggen6-Sep-22 6:14
professionalEddy Vluggen6-Sep-22 6:14 
GeneralRe: MultiThread on Single Core Processor (CPU) Pin
Dave Kreskowiak6-Sep-22 6:18
mveDave Kreskowiak6-Sep-22 6:18 
GeneralRe: MultiThread on Single Core Processor (CPU) Pin
Eddy Vluggen6-Sep-22 6:19
professionalEddy Vluggen6-Sep-22 6:19 
AnswerRe: MultiThread on Single Core Processor (CPU) Pin
Sam Hobbs5-Oct-22 21:19
Sam Hobbs5-Oct-22 21:19 
Question_ViewImports.cshtml question Pin
pkfox23-Aug-22 23:15
professionalpkfox23-Aug-22 23:15 
AnswerRe: _ViewImports.cshtml question Pin
Richard Deeming23-Aug-22 23:47
mveRichard Deeming23-Aug-22 23:47 
GeneralRe: _ViewImports.cshtml question Pin
pkfox24-Aug-22 0:13
professionalpkfox24-Aug-22 0:13 
GeneralRe: _ViewImports.cshtml question Pin
Richard Deeming24-Aug-22 0:29
mveRichard Deeming24-Aug-22 0:29 

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.