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 is a parallel query execution engine for . PLINQ supports the data parallelism pattern by adding additional syntax to allow queries to be declared as running in parallel.

Related Links

365 questions
7
votes
2 answers

returning null with PLINQ

i have an extension method for IEnumerable which then iterates through the collection, doing its business, and then returns an new IEnumerable. I have tried to use PLINQ using .AsParallel().ForAll() which speeds up the iterations significantly…
benpage
  • 4,418
  • 3
  • 41
  • 39
7
votes
1 answer

Undo Enumerable.AsParallel(), going back to serial mode

Assume you have a LINQ query like source.AsParallel().Where(expensiveOperation).Select(cheapOperation) I suppose in this case Select also runs in parallel execution mode. Maybe it's just a cheap operation like i => i*2, so is there a way to stop…
ahmet alp balkan
  • 42,679
  • 38
  • 138
  • 214
7
votes
3 answers

How AsParallel extension actually works

So topic is the questions. I get that method AsParallel returns wrapper ParallelQuery that uses the same LINQ keywords, but from System.Linq.ParallelEnumerable instead of System.Linq.Enumerable It's clear enough, but when i'm looking into…
Alex Zhukovskiy
  • 9,565
  • 11
  • 75
  • 151
7
votes
4 answers

Why does PLINQ use only two threads?

Say I have an IO-bound task. I'm using WithDegreeOfParallelism = 10 and WithExecution = ForceParallelism mode, but still the query only uses two threads. Why? I understand PLINQ will usually choose a degree of parallelism equal to my core count, but…
ripper234
  • 222,824
  • 274
  • 634
  • 905
7
votes
2 answers

Taking advantage of PLINQ with custom Enumerable Extensions

Many custom Enumerable extensions can be implemented in terms of other builtin operations - for example this trivial convenience method: public static bool AnyOf(this TElement item, IEnumerable items) { return items.Any(a =>…
Fowl
  • 4,940
  • 2
  • 26
  • 43
7
votes
1 answer

PLINQ query giving overflow exception

I'm running a PLINQ query as follows: ParallelQuery winningCombos = from n in nextComboMaker.GetNextCombo() .AsParallel().WithCancellation(_cancelSource.Token) …
Mark W
  • 3,879
  • 2
  • 37
  • 53
7
votes
2 answers

How to implement MapReduce in C# using PLINQ?

How to implement MapReduce in C# using PLINQ? Suppose, you have 7-8 WebServices to collect data and on each receiving (async manner) you have to put that data into some tables of a database, in my case it is SQL Server 2008. For instance the data…
Ramiz Uddin
  • 4,249
  • 4
  • 40
  • 72
6
votes
3 answers

Pitfalls of trying to use PLINQ over long-running generators?

I have a few infinite generator methods, including some long-running and infinitely-long-running generators. IEnumerable ExampleOne() { while(true) // this one blocks for a few seconds at a time yield return…
Jimmy
  • 89,068
  • 17
  • 119
  • 137
6
votes
1 answer

Task vs AsParallel()

On page 33 of Stephen Toub's book http://www.microsoft.com/download/en/details.aspx?id=19222 There is the code var pings = from addr in addrs.AsParallel().WithDegreeOfParallelism(16) select new Ping().Send(addr); foreach (var ping in pings) …
TheWommies
  • 4,922
  • 11
  • 61
  • 79
6
votes
2 answers

Plinq gives different results from Linq - what am I doing wrong?

Can anyone tell me what the correct Plinq code is for this? I'm adding up the square root of the absolute value of the sine of each element fo a double array, but the Plinq is giving me the wrong result. Output from this program is: Linq aggregate =…
Matthew Watson
  • 104,400
  • 10
  • 158
  • 276
6
votes
1 answer

Why PLinq doesn't support more than 63 parallel threads?

I think the question is clear. PLinq doesn't allow you to create more than 63 threads (WithDegreeOfParallelism doesn't allow it, throws ArgumentOutOfRangeException). In rare situations, we need to acquire more than 63 thread from thread pool (such…
Davita
  • 8,928
  • 14
  • 67
  • 119
6
votes
3 answers

Parallel Foreach Memory Issue

I have a file collection (3000 files) in a FileInfoCollection. I want to process all the files by applying some logic which is independent (can be executed in parallel). FileInfo[] fileInfoCollection = directory.GetFiles(); …
Jayantha Lal Sirisena
  • 21,216
  • 11
  • 71
  • 92
6
votes
4 answers

Threading, CultureInfo .net , TPL, PLINQ

It is not possible to set an entire .net application to another culture other than the user profile-culture in .net. The appropriate way to control cultureinfo seems to be using the dedicated methods on objects such as DateTime. However, when…
6
votes
3 answers

Silverlight 4 PLINQ

I have a very simple question. Is it possible to use PLINQ with Silverlight 4 since it seems that it doesn't exist in the most commonly referenced assemblies?
SilverDark
  • 275
  • 2
  • 6
6
votes
1 answer

AsParallel() executing sequentially

I have the following PLINQ query: // Let's get a few customers List customers = CustomerRepository.GetSomeCustomers(); // Let's get all of the items for all of these customers List items = customers .AsParallel() …
Dave New
  • 38,496
  • 59
  • 215
  • 394