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
210
votes
7 answers

When to dispose CancellationTokenSource?

The class CancellationTokenSource is disposable. A quick look in Reflector proves usage of KernelEvent, a (very likely) unmanaged resource. Since CancellationTokenSource has no finalizer, if we do not dispose it, the GC won't do it. On the other…
70
votes
2 answers

How do Reactive Framework, PLINQ, TPL and Parallel Extensions relate to each other?

At least since the release of .NET 4.0, Microsoft seems to have put a lot of effort in support for parallel and asynchronous programming and it seems a lot of APIs and libraries around this have emerged. Especially the following fancy names are…
bitbonk
  • 48,890
  • 37
  • 186
  • 278
41
votes
5 answers

Exactly what is PLINQ?

PLINQ was added in the .NET 4.0 Framework as an extension to LINQ. What is it? What problems does it solve? When is it appropriate and when not?
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
38
votes
3 answers

Max Degree of Parallelism for AsParallel()

While using Parallel.ForEach we have the option to define the Parallel options and set the Max Degree of Parallelism like : Parallel.ForEach(values, new ParallelOptions {MaxDegreeOfParallelism = number}, value = > { // Do Work }) But while…
codingpirate
  • 1,414
  • 1
  • 12
  • 20
25
votes
1 answer

In PLINQ, what is the difference between .AsSequential() and .AsOrdered()?

I can't seem to wrap my head around what the difference is between AsSequential and AsOrdered. I have looked up documentation on msdn for each of these as well as searching the internet for examples, but I am just a simple shoe cobbler and I was…
user2565663
  • 1,149
  • 13
  • 15
24
votes
2 answers

Running a simple LINQ query in parallel

I'm still very new to LINQ and PLINQ. I generally just use loops and List.BinarySearch in a lot of cases, but I'm trying to get out of that mindset where I can. public class Staff { // ... public bool Matches(string searchString) { // ... …
user1002358
  • 2,852
  • 6
  • 22
  • 32
23
votes
5 answers

How to properly parallelise job heavily relying on I/O

I'm building a console application that have to process a bunch of data. Basically, the application grabs references from a DB. For each reference, parse the content of the file and make some changes. The files are HTML files, and the process is…
Steve B
  • 36,818
  • 21
  • 101
  • 174
21
votes
2 answers

Where to call .AsParallel() in a LINQ query

The question In a LINQ query I can correctly (as in: the compiler won't complain) call .AsParallel() like this: (from l in list.AsParallel() where select l).ToList(); or like this: (from l in list where select…
user7061022
19
votes
1 answer

Does Parallel.ForEach require AsParallel()

ParallelEnumerable has a static member AsParallel. If I have an IEnumerable and want to use Parallel.ForEach does that imply that I should always be using AsParallel? e.g. Are both of these correct (everything else being equal)? without…
dkackman
  • 15,179
  • 13
  • 69
  • 123
19
votes
3 answers

Track progress when using TPL's Parallel.ForEach

What is the best way way to track progress in the following long total = Products.LongCount(); long current = 0; double Progress = 0.0; Parallel.ForEach(Products, product => { try { var price = GetPrice(SystemAccount, product); …
Madu Alikor
  • 2,544
  • 4
  • 21
  • 36
17
votes
1 answer

Is it OK to try to use Plinq in all Linq queries?

I read that PLinq will automatically use non parallel Linq if it finds PLinq to be more expensive. So I figured then why not use PLinq for everything (when possible) and let the runtime decide which one to use. The apps will be deployed to multicore…
Tony_Henrich
  • 42,411
  • 75
  • 239
  • 374
16
votes
2 answers

Parallel Linq query optimization

For some time now I've been structuring my code around methods with no side-effects in order to use parallel linq to speed things up. Along the way I've more than once stumbled on lazy evaluation making things worse instead of better and I would…
David K.
  • 6,153
  • 10
  • 47
  • 78
16
votes
2 answers

C#: AsParallel - does order matter?

I'm building a simple LinQ-to-object query which I'd like to parallelize, however I'm wondering if the order of statements matter ? e.g. IList items; var result = items .Select(item => item.FindControl("somecontrol")) …
Steffen
  • 13,648
  • 7
  • 57
  • 67
16
votes
5 answers

Are you using Parallel Extensions?

I hope this is not a misuse of stackoverflow; recently I've seen some great questions here on Parallel Extensions, and it got my interest piqued. My question: Are you using Parallel Extensions, and if so, how? My name is Stephen Toub and I'm on the…
15
votes
2 answers

Is there an asynchronous version of PLINQ?

I want to execute a query over a stream of data while processing items in parallel with a certain degree of parallelism. Normally, I'd use PLINQ for that, but my work items are not CPU bound but IO bound. I want to use async IO. PLINQ does not…
usr
  • 168,620
  • 35
  • 240
  • 369
1
2 3
24 25