Skip to main content

Questions tagged [task-parallel-library]

The Task Parallel Library is part of .NET 4 and .NET 4.5. It is a set of APIs to enable developers to program asynchronous applications.

Filter by
Sorted by
Tagged with
6 votes
1 answer
373 views

.NET 8 finally introduced a time abstraction that can be used to fake advance a clock while testing certain components. https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider?view=net-9.0 ...
JaggerJo's user avatar
  • 163
4 votes
1 answer
191 views

This is a tiny class that creates backup copies of a file so these can be diff'ed to spot the changes compared to last run; used when generating code and so far has proved to be very helpful. ...
aybe's user avatar
  • 612
1 vote
1 answer
653 views

I am enjoying making various programs with C++. This is my first code review request. And I hope I can get some insights or might have good advice to make my code better. I make a task class using C++...
Y.frank's user avatar
  • 29
2 votes
0 answers
606 views

I'm using the SerialPort in C# using Visual Studio 2019. My SerialPort has 2 "pump" tasks, which are private members of my SerialPort, and are started during an Initialization method: ...
Hans Billiet's user avatar
1 vote
1 answer
716 views

I have following code: ...
leroy's user avatar
  • 13
1 vote
1 answer
558 views

This service takes in a report request object that can contain multiple reports that need to be rendered. This code works but I'm not sure if I've implemented anything wrong. Note the ...
Usman Khan's user avatar
5 votes
1 answer
760 views

I have come across a situation where I feel running some code in parallel will greatly improve performance, but I am concerned about the implementation and am looking for some confirmation. Take the ...
ZMJ's user avatar
  • 51
1 vote
1 answer
517 views

I have a potentially long running operation and I want to trigger some action if takes too long time. Also I want to reuse this logic. Operation to check: ...
Maxim Tkachenko's user avatar
4 votes
2 answers
216 views

I am writing an app that is supposed to simulate load on our web api and NServiceBus(particular) service. This is the first time I am writing an application like this. It appears to run ok, however ...
Kixoka's user avatar
  • 143
0 votes
2 answers
297 views

I wrote some function to compare the duration taken for 1000 loops. Just wondering if the comparison is right? For the thread, I want to set to maximum 3 thread. Thread is ...
Steve Ngai's user avatar
1 vote
2 answers
592 views

Simple Console Application for checking if one of the hosts is available. The implementation should be for around 5 hosts to check with different response times and the method should return fast when ...
Matthias Herrmann's user avatar
4 votes
1 answer
772 views

I'm trying to build an iterator (enumerator) that can select specific elements in an Expression tree by traversing the tree and deferring further iteration until ...
Rhaokiel's user avatar
  • 141
2 votes
0 answers
144 views

I have a class, 'TaskCoordinator' which has 'BaseTask's applied to it. The BaseTasks have OnStarted, OnFinished and OnCancelled events which are triggered to notify the calling class of their events....
Timmoth's user avatar
  • 21
5 votes
2 answers
370 views

Because I'm quite naive regarding C#'s Task Asynchronous Programming and concurrency in general, and because it's so difficult to test, I'm concerned about the safety of this code. It's likely that ...
shannon's user avatar
  • 151
7 votes
1 answer
2k views

i've been working on an implementation of a my own from scratch set of library Astron and I wanted to get my TPL usage reviewed because i'm not confident with this technology :/ My app is currently ...
Nameless's user avatar
  • 163
1 vote
0 answers
892 views

I have a deviceList of more than 10k items and want to send data by calling another method. I tried to use Parallel.Foreach but I'm not sure is this the correct ...
Neo's user avatar
  • 119
1 vote
1 answer
179 views

I'm using a database that has a library for access to it. Connection is done synchronously, it's blocking and I do not have a way to abort it. To connect, I have to write: ...
Loreno's user avatar
  • 143
1 vote
0 answers
767 views

Task: Create a service which will synchronize files on FTP server with files on local drive. FTP server allows up to 15 concurent connections Synchronize the files as fast as possible Files on FTP ...
inwenis's user avatar
  • 303
2 votes
0 answers
84 views

I've recently been dipping my toes in to async code so I'm not 100% sure if there's a better way to do this, or if I'm going to run into problems down the road. I plan on using the following class in ...
itsDrew's user avatar
  • 21
6 votes
2 answers
6k views

In a recent project I worked on we faced some issues due to an excess of parallelization (thousands of threads were created and the overall result was a degradation of performance and several spikes ...
Enrico Massone's user avatar
5 votes
1 answer
199 views

When writing asynchronous code in F#, one often needs to call methods in the .NET BCL that return Task or Task<T> rather ...
Aaron M. Eshbach's user avatar
1 vote
1 answer
2k views

I had a foreach loop which used to loop Membership users and create list of a custom class. Following was the for loop: ...
Vinit Divekar's user avatar
2 votes
3 answers
2k views

Here is a sample code to explain the approach I am going for. ...
danish's user avatar
  • 157
3 votes
2 answers
151 views

Please assist and review the following task. There are many geographic data to be found using the Bing Map server. It is necessary to collect data, parse bing response and store it in one of two ...
Disappointed's user avatar
6 votes
1 answer
5k views

I've got some methods that follow a similar pattern, and wanted to abstract some of the logic away into an extension method. Specifically, I am processing lists of objects with the TPL, and throttling ...
JohnWick's user avatar
  • 425