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
6
votes
1 answer

Why would OutOfMemoryException be thrown while using PLINQ Take()?

After I upgraded to DotNet 4.5, a query started giving me OutOfMemoryExceptions. The (distilled) query is: var tests = new int[]{} .AsParallel() .GroupBy(_ => _) .Take(int.MaxValue) .ToArray(); I'm posting this for anyone with the…
Pablo Montilla
  • 2,941
  • 1
  • 31
  • 35
6
votes
1 answer

Application hangs using PLINQ AsParallel(). No problems with LINQ

I'm new to LINQ and PLINQ, and I'm building a project to test them. Stub: class Stub { private Boolean mytf; public Stub() { Random generator = new Random(); if (generator.NextDouble() < 0.5) { mytf =…
qwertoyo
  • 1,332
  • 2
  • 15
  • 31
6
votes
2 answers

Why is my AsOrdered PLINQ query faster than my unordered one

I wrote some basic sample code to familiarise myself with PLINQ. I came across something weird. I don't know if it's an error in my code or an error in my understanding of PLINQ. The MSDN documentation states that adding AsOrdered() will preserve…
Gilles
  • 5,269
  • 4
  • 34
  • 66
5
votes
2 answers

LINQ: How to modify the return type of AsParallel depending on a context?

LINQ's AsParallel returns ParallelQuery. I wonder if it's possible to change this behavior so that I could compare the LINQ statement run with and without parallelism without actually changing the code? This behavior should be similar to…
Schultz9999
  • 8,717
  • 8
  • 48
  • 87
5
votes
1 answer

Making PLINQ and BlockingCollection work together

I have put together a simple application that monitors file creation events, creates some objects from the files content, and does some processing. Here is the sample code: class Program { private const string Folder = "C:\\Temp\\InputData"; …
Yuriy Magurdumov
  • 235
  • 2
  • 12
5
votes
2 answers

Task.Wait in ContinueWhenAll Action

I was working on encorperating threads into my azure code for putting things on a queue. to do this i used http://www.microsoft.com/download/en/details.aspx?id=19222 as a reference. my code to enqueue multiple messages looks like this: public void…
Didier Caron
  • 570
  • 3
  • 9
5
votes
3 answers

PLINQ: how to run a ParallelQuery on more than 4 threads?

Update - changed the title of the question to reflect what I'm really after Consider the following piece of code: // this query generates 12 instances of Func, which each when executed // print something to the console and wait for 1…
jeroenh
  • 26,362
  • 10
  • 73
  • 104
5
votes
1 answer

Possible reasons why ParallelQuery.Aggregate does not run in parallel

I would appreciate any help from the PLYNQ experts out there! I will take time reviewing answers, I have a more established profile on math.SE. I have an object of type ParallelQuery>, which has 44 lists which I would like to process in…
Szmagpie
  • 192
  • 2
  • 11
5
votes
2 answers

parallel linq: AsParallel().forAll() nulls some objects

So, I've got a very weird situation here where it seems a forAll() plinq-query removes some of my custom objects and, to be honest, I have no clue why. var myArticles = data.FilterCustomerArticles([]params]).ToList(); //always returns 201…
Dominik
  • 2,801
  • 2
  • 33
  • 45
5
votes
2 answers

is it ok to use plinq ForAll for a bulk insert into database?

I'm doing like this: entities.AsParallel().ForAll(o => repository.Insert(o)); is this good, am I going to have more performance with this ?
Omu
  • 69,856
  • 92
  • 277
  • 407
5
votes
2 answers

Can't get file icon for files associated with Windows apps when using AsParallel()

I want to display the icons associated with files. This isn't a problem for file types associated with normal desktop applications but only for those associated with (metro/modern) apps. If a file type is associated with an app and I am using…
Stefan Hoffmann
  • 3,214
  • 16
  • 30
5
votes
2 answers

How does AsParallel() split it's 'source'?

I'm trying to determine how AsParallel() splits it's 'source', and indeed what is meant by 'source'... For example... public class CSVItem { public DateTime Date { get; set; } public string AccountNumber { get; set; } } List
Paul Zahra
  • 9,522
  • 8
  • 54
  • 76
5
votes
1 answer

Parallel LINQ - .Select() + .ForAll() returning bizarre results

For the life of me, I can't figure out why all the foos are not null. I'm assuming the .ForAll() should be executing before I call the .All() method, but it's not? public class Foo { public string Bar { get; set; } } static void Main(string[]…
Brad M
  • 7,857
  • 1
  • 23
  • 40
5
votes
2 answers

How to use IObservable/IObserver with ConcurrentQueue or ConcurrentStack

I realized that when I am trying to process items in a concurrent queue using multiple threads while multiple threads can be putting items into it, the ideal solution would be to use the Reactive Extensions with the Concurrent data structures. My…
James Black
  • 41,583
  • 10
  • 86
  • 166
5
votes
2 answers

Linq fast intersect query - enhancement?

In our company there are thousands(!) of cars. each car has a GPS device which sends periodically (cycle) its location. So each Cycle contains : List ( cars that sent location – corresponding to the CycleNum) CycleNum which is Cycle…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792