The Task Parallel Library is part of .NET 4. It is a set of APIs to enable developers to program multicore shared memory processors.
0
votes
0answers
11 views
Limit Parallel.ForEach to only 64 actions
I have the following code to insert data into an excel file:
Parallel.ForEach(fileNames.ToArray(), filename =>
{
OleDbConnection cn = new OleDbConnection(connect to filename.xlsx)
...
1
vote
0answers
7 views
How to save a dump, including local variables, after an unhandled exception occurs in TPL?
My idea of handling exceptions is as follows.
When an unhandled exception occurs, I want to save a dump with full memory, including local variables available at the line where the exception happened. ...
0
votes
1answer
26 views
The result of a query cannot be enumerated more than once
I had a question pertainning to Parelle and Task in this thread. Previous Question Related to this one
What I am attempting to do is iterate over a collection returned from the entity framework via a ...
0
votes
0answers
13 views
Ensure Task proper execution in ASP.NET
I have a background repeating task, which is created on application startup. It executes some code and sleeps in endless loop. Without this task, the application will fail to execute correctly. The ...
1
vote
2answers
53 views
Parallel.ForEach not setting all values in loop
I am querying a sql data base for some employees.
When i receive these employees I and looping each one using the Parallel.ForEach.
The only reason I'm looping he employees that was retrieved from ...
4
votes
1answer
33 views
How should I propagate task exception from continuation task in .NET 4.0?
I have the following code:
innerExceptions = dbconnByServer
.AsParallel()
.WithDegreeOfParallelism(dbconnByServer.Count)
// A stream of groups of server connections proceeding in parallel ...
-1
votes
1answer
33 views
Adding Controls to a panel in Parallel or Concurrent
there is panel which I want to add k controls to it . I want to specify task for each of this controls for later use . so :
*UPDATE AT BELOW WITH A SOME OTHER CODES ; Please watch third code *
...
0
votes
1answer
32 views
Suitable pattern for updating a progress bar from multiple threads (using TPL?)
I've been busy updating my brain with the TPL because I intend on using it for my new application (which uses .Net Framework 4.0). However I have some doubts that someone might clarify for me. ...
0
votes
2answers
49 views
How to invoke a list of Task<T> by using Parallel
I've got a list of async calls that are lined up in specific order and it does not matter which one finishes first or last. All of these async Task returns Bitmaps. All of the async Task return a ...
4
votes
1answer
51 views
Why do I have Task that last for 10 seconds
I am currently studying TPL and have come up with the very first test that already does not produce the expected output. Is my code wrong or is it the expected result
What puzzle me is the fact that I ...
1
vote
2answers
28 views
Providing synchronous and asynchronous versions of an API in library code
Is there a recommended best practices/guidance for exposing synchronous and asynchronous versions of an API in a class library? For instance, if I have the following 2 methods defined in a class ...
1
vote
2answers
32 views
Cannot cancel a task via CancellationTokenSource.Cancel()
I am having trouble stopping a Task. Firstly, I just started using Tasks. Previously, I had been using delegate.BeginInvoke() to run things in background, but this time I need to stop background ...
1
vote
1answer
20 views
Run a method and update progressbar using tpl
I have the following class:
class MyClass
{
public void timeConsumingCode(){
for(int i=0; i<100; i++)
{
Threading.Thread.Sleep(1000);
}
}
}
and then i ...
0
votes
1answer
31 views
Should I implement async Parallel or async Task
All of this code is in a class library at the lowest level.
For the code block below should I wrap the entire body of code in a Task.Run(()=>{}); or is there a better way to fire each one of those ...
0
votes
1answer
27 views
Exception when using Task for parallel processing
I am using Task in System.Threading.Tasks.Task and creating an array of Tasks
var taskArray = new Task<IAvailabilityResult>[numberOfElements];
I am getting an exception when I run this code.
...