The Task Parallel Library is part of .NET 4. It is a set of APIs to enable developers to program multicore shared memory processors.

learn more… | top users | synonyms (1)

1
vote
1answer
9 views

How can I unit test code that contain Task.Delay?

How can I unit test component that has an await Task.Delay without really having to wait for it. For example, public void Retry() { // doSomething(); if(fail) await Task.Delay(5000); ...
0
votes
0answers
23 views

In WPF MVVM parallel C# application UI decelerates response on user action [on hold]

I develop now a C# WPF application according to MVVM pattern. For realization of parallelism in the application I use TPL. The application is intended for automatized trading on stock exchange. The ...
0
votes
2answers
39 views

Task.Wait Method (CancellationToken)

Can someone please explain to me to the usage of the Task.Wait(CancellationToken) overload? MSDN does say much about it... This is how I usually handle task cancellations: var source = new ...
0
votes
3answers
26 views

Sync Lock issue in Parallel.Foreach

I have worked with c# code for past 4 years, but recently I went through a scenario which I never pass through. I got a damn project to troubleshoot the "Index out of range error". The code looks ...
1
vote
1answer
51 views

async / await - am I correctly running these methods in parallel?

I have an abstract class called VehicleInfoFetcher which returns information asynchronously from a WebClient via this method: public override async Task<DTOrealtimeinfo> getVehicleInfo(string ...
0
votes
1answer
28 views

Proper use of ParallelOptions, TaskCreationOptions and Task.Factory.StartNew?

Please suggest which method is proper(if any) for correct and efficient use of ParallelOptions, TaskCreationOptions and Task.Factory.StartNew(() =>. private void ...
1
vote
2answers
30 views

Getting items from different sources in parallel and returning the result

I have some code that looks something similar to this: public IList<Result> GetResult() { var result = new List<Result>(); result.AddRange(GetSomeItemsA()); ...
-2
votes
0answers
23 views

How to use ParallelOptions with TaskCreationOptions for Task.Factory.StartNew?

CancellationTokenSource tokenFor_task_tpl_Pair01 = new CancellationTokenSource(); ParallelOptions parOpts = new ParallelOptions(); parOpts.CancellationToken = ...
-1
votes
0answers
29 views

Process 10 Records In Parallel [on hold]

I have to fetch records from a database table in every 30 seconds if the status column of the records has value "In Progress", Then I want to perform some operations on the queried records 10 in ...
2
votes
2answers
48 views

Structuring Task Processing Pipeline with the Task Parallel Library

I come from an Objective-C background, where I would use Grand Central Dispatch or NSOperations to solve this problem fairly trivially. Unfortunately I think I'm stuck in that way of thinking when ...
-1
votes
1answer
22 views

When is useful to use SpinLock sync primitive in .NET?

I am learning basics of parallel programming in .NET and I am wondering why someone would need to use SpinLock sync primitive. I read that using of this mechanism avoids rescheduling when waiting for ...
0
votes
1answer
20 views

How to use virtual time for Task.Run when testing Observables with Reactive Extensions

I have the following function I wish to test /// Items are processed asynchronously via fn as they arrive. However /// if an item arrives before the last asynchronous operation has /// completed then ...
0
votes
0answers
15 views

System.PlatformNotSupportedException:This platform is not supported| with Tasks & VS & MonoTouch

I'm trying to have Tasks working under Visual Studio 2012 with MonoTouch. I'm using ALPHA channel and have the latest releases installed. There are 3 projects in solution: 1. PCL (158 target ...
0
votes
0answers
40 views

My service task dies with no reason

I have a task in windows service. Heres the code of interest: private Task Schedule(Action action, int interval, EventDefinition restoreEvent = null) { return new Task(() => { bool ...
0
votes
2answers
25 views

scalability in client object model vs web services

I have a app in which I need to query a sharepoint site via services. The app will be under heavy usage so performance and scalability will be two of my priorities. I started to investigate which ...

1 2 3 4 5 124
15 30 50 per page