Questions tagged [parallel-extensions]

Parallel Extensions is a managed concurrency library included in the .NET 4.0 release.

Parallel Extensions is a managed concurrency library included in the .NET 4.0 release. It is composed of two parts: Parallel LINQ (PLINQ) and Task Parallel Library (TPL).

124 questions
2
votes
1 answer

How to pass different range on parallel.for?

I need to process the single file in parallel by sending skip-take count like 1-1000, 1001-2000,2001-3000 etc Code for parallel process var line = File.ReadAllLines("D:\\OUTPUT.CSV").Length; Parallel.For(1, line, new ParallelOptions {…
Mahendran
  • 468
  • 8
  • 19
2
votes
1 answer

Parallel.Invoke the same method for a list of objects

I have a class MyClass with a method MyMethod. For every MyClass instance in a list of MyClass instances i want to invoke MyMethod and have them run in a separate thread. I am using .NET 4.0 and the Parallel extensions.
kjv
  • 11,047
  • 34
  • 101
  • 140
2
votes
2 answers

How to await Parallel Linq actions to complete

I'm not sure how I'm supposed to mix plinq and async-await. Suppose that I have the following interface public interface IDoSomething ( Task Do(); } I have a list of these which I would like to execute in parallel and be able to await the…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
2
votes
3 answers

Filtering IEnumerable Pattern

Consider the following simple code pattern: foreach(Item item in itemList) { if(item.Foo) { DoStuff(item); } } If I want to parallelize it using Parallel Extensions(PE) I might simply replace the for loop construct as…
redcalx
  • 8,177
  • 4
  • 56
  • 105
2
votes
3 answers

Can I configure the number of threads used by Parallel Extensions?

I'm currently using the Parallel Extensions that are part of Reactive Extensions for .Net(Rx). I believe they are also available through .Net 4 beta releases. 1) Is there any way to determine how many threads are actually being utilized. I assume…
redcalx
  • 8,177
  • 4
  • 56
  • 105
2
votes
1 answer

System.Threading.ThreadAbortException fired in new thread

I am currently working in .net c# 4.0 and have come across an issue with some code that I written that is causing me some headaches. I am using the System.Threading.Tasks.TaskFactory class in conjunction with System.Threading.Tasks.TaskScheduler to…
amateur
  • 43,371
  • 65
  • 192
  • 320
1
vote
2 answers

MemoryBarriers and Parallel Extensions

Is there a need to be concerned about MemoryBarriers when using the Parallel Extensions? Edit - to elaborate as the original question was open ended: (@xanatos' answer was the one I was looking for) To give a concrete example: assume I use a…
dugas
  • 12,025
  • 3
  • 45
  • 51
1
vote
1 answer

Silverligh 5 SDK RC + Async CTP : make it work

Just installed the Silverligh 5 SDK RC. There is a problem using it inside a project that uses the Async CTP. Both AsyncCtpLibrary_Silverlight.dll and mscorlib.dll contains the Task type (And some other Task related types) that is sitting in the…
1
vote
2 answers

Unexpected segfault with __gnu_parallel::accumulate

This is really confusing me, I would appreciate if anyone could help me out. (EDIT: thought it was a templated problem, I was mistaken with this) I want to add multiple copies of the following class with gnu's parallelised accumulate algorithm…
Tom
  • 5,219
  • 2
  • 29
  • 45
1
vote
1 answer

Is there any other way to get the Feature Name in SpecFlow C# without using Context?

I'm using the Feature Name and step details in ExtentReports. When I execute individual test it is working fine. If I try to execute test in Parallel it is Throwing error, we should not use Context in Multi thread.
K.Krishnakanth
  • 127
  • 1
  • 15
1
vote
2 answers

Using Parallel Extensions or Parallel LINQ with LINQ Take

I have a database with about 5 million rows in it. I am trying to generate XML strings for the database and push them to a service. Instead of doing this one at a time, the service supports taking 1000 records at a time. At the moment, this is quite…
TiernanO
  • 1,597
  • 14
  • 31
1
vote
3 answers

How to process queued items serially on a low priority thread using Parallel Extensions

I want to know what the best way to process the results of a long-running process serially but on a low-priority thread using the .NET 4.0 Parallel Extensions. I have the following class that both does the execution and provides the results: public…
1
vote
1 answer

How efficient is this parallelisation code? Is there a better way to do it?

I'm building a large Lucene index and each document I insert requires a little bit of "putting together" before it can be inserted. I'm reading all of the documents from a database and inserting them into the index. Lucene allows you to build a few…
Nathan Ridley
  • 33,766
  • 35
  • 123
  • 197
1
vote
1 answer

Good Learning Material on Parallel Extension of .Net 4

Can anybody please suggest me some good learning materials on the new Parallel Extensions and its use in .Net 4 except the MSDN one, so that I can learn - parallel programming on .Net 4 the basic differences between non-parallel and parallel…
1
vote
2 answers

Simple way to concurrently subscribe to observable collection with limited subscribers

I've been trying to implement a simple producer-consumer pattern using Rx and observable collections. I also need to be able to throttle the number of subscribers easily. I have seen lots of references to LimitedConcurrencyLevelTaskScheduler in…
1 2 3
8 9