Skip to main content

Questions tagged [plinq]

PLINQ is a parallel query execution engine for LINQ. PLINQ supports the data parallelism pattern by adding additional syntax to allow queries to be declared as running in parallel.

plinq
-1 votes
1 answer
102 views

How to get results from List<T>.AsParallel() in C#

I have an asynchronous async static public Task<int> Test(int x, int y) { await Task.Delay(1000); return x; } And I try to run it in parallele on a list. I did like that: var x = new[] { ...
Nicolas REY's user avatar
4 votes
2 answers
250 views

Why does ToList() make a sorted order?

When I execute the following code: using static System.Console; var numbers = ParallelEnumerable.Range(0, 50); WriteLine("\nNumbers divisible by 5 are:"); var divisibleBy5 = numbers ....
Vaskaran Sarcar's user avatar
4 votes
0 answers
105 views

PLINQ behaves differently in .NET 8

Run the following code: using System; using static System.Console; var numbers = Enumerable.Range(0, 31); WriteLine("\nNumbers divisible by 5 are(using LINQ):"); numbers .Where(num => ...
Vaskaran Sarcar's user avatar
0 votes
0 answers
63 views

Is there a way to dynamically change DegreeOfParallelism in a PLINQ query?

I want to convert a large array of objects in parallel using PLINQ. var outputs = inputs .AsParallel() .AsOrdered() .WithDegreeOfParallelism(8) // make this number dynamic .Select(...
stb's user avatar
  • 842
0 votes
0 answers
49 views

How to trace ETW Events inside Parallel.ForEach in C#

Need your help to understand how can we log ETW events to track Task started & Task completed inside parallel.foreach. I basically need to see when event got fired. I have gone through few ...
Sks's user avatar
  • 610
4 votes
3 answers
741 views

Using a partitioner in C# to parallel query a REST-API with pagination

I was wondering if my approach is good to query a REST-API in parallel because there is a limit on how many results can be obtained with one request (1000). To speed up things I want to do this in ...
Alexander Schmidt's user avatar
2 votes
2 answers
242 views

PLINQ ForAll WithCancellation is not working

I wrote a PLINQ query that ends with the ForAll operator, and I used the WithCancellation operator in order to cancel the query midway. Surprisingly the query is not canceled. Here is a minimal ...
Theodor Zoulias's user avatar
3 votes
2 answers
144 views

Exception is lost while consuming a PLINQ query

I observed a weird behavior while experimenting with a PLINQ query. Here is the scenario: There is a source IEnumerable<int> sequence that contains the two items 1 and 2. A Parallel LINQ Select ...
Theodor Zoulias's user avatar
1 vote
1 answer
198 views

Find all the child nodes from self referenced DataTable using parent ID and update particular column on a bulk data

I have a self-referenced table like below. key parent Description A NULL B A C B D C And initially having 1 Key value. Using this key value, I need to find all the child nodes recursively and ...
Yashas's user avatar
  • 31
2 votes
1 answer
218 views

How to create a custom grouped / hashed PLINQ partitioner or parallel query

I am trying to process a list of file paths in parallel using PLINQ. I have to process all files with the same name, excluding extension, in the same thread, as that thread may be renaming file ...
PieterV's user avatar
  • 573
2 votes
2 answers
288 views

Memory leak in using PLinq AsParallel

I wrote a piece of testing code using AsParallel to concurrently read big files. It causes memory leak. It seems GC doesn’t recycle the unused objects as expected. Please see the code snippet. ...
Frank Feng's user avatar
2 votes
1 answer
244 views

PLINQ vs Sync Over Async: what is the difference?

I love PLINQ. In all of my test cases on various parallelization patterns, it performs well and consistently. But I recently ran into a question that has me a little bothered: what is the functional ...
RTD's user avatar
  • 364
0 votes
0 answers
31 views

Conditionally use PLINQ with minimal code duplication [duplicate]

I have some LINQ code that under some conditions, which I can test for, benefits from parallelization. I would like to use PLINQ when such conditions apply, but also avoid to have all the processing ...
rzippo's user avatar
  • 1,039
0 votes
1 answer
188 views

Converting Parallel ForEach into PLINQ to process list of Tasks [closed]

I am trying to load as many messages into a server fast as possible. I currently have this bit of code and to load 50000 messages to a MessagingServer it takes around 5 minutes. This is a list of ...
Terrance Jackson's user avatar
0 votes
0 answers
120 views

IQueryable (PLINQ) peek and group Linq methods to run in different tasks

I want to divide a IQueryable into several ones, like the image below, extracted from the explanation of the .AsParallel(). But instead of running all in parallel, I want to run some of them together, ...
Júlio Almeida's user avatar

15 30 50 per page
1
2 3 4 5
25