All Questions
17 questions
0
votes
2
answers
176
views
Options to achieve parallel execution in C#
I have a use case where I need to process n number of operations, which involves other I/O operations.
Method 1: Uses ConcurrentBag<T>.
But worried that the I/O operations in the ...
0
votes
0
answers
141
views
How to run parallel operations on set of files?
So I'm trying to run parallel operations on a set of files using C#.
The first operation converts the file type and stores it in a temporary folder. The second operation does some processing to the ...
2
votes
1
answer
2k
views
Getting file header corrupt error while trying to process each individual file types in parallel within zip file
I have a zip file available in azure blob storage which contains 2 types of files, A & B.
I need to read file from azure blob storage and process each of file in parallel.
I am trying here most ...
0
votes
1
answer
113
views
How to parallelize method for creating a List and track each element position/index in C#
I have a method which creates 1000 surfaces in a loop and store them in the list:
List<Surface> surfaces = new List<Surface>();
for (int i = 0; i < 1000; i++){
Surface surface = ...
11
votes
2
answers
4k
views
Are the ParallelExtensions "Extras" still of value?
The Task Parallels Extras extension was published in 2010, and since then no updates have been released.
I published this code as a DLL on Nuget 3 years ago and it has had over 16,000 downloads, ...
0
votes
1
answer
54
views
What can cause my TPL tasks to stop running?
I have the following code:
while (true)
{
Task.Run(() =>{
var request = WebRequest.Create("url1");
request.GetResponse();
});
Task.Run(() =>{
var request = ...
1
vote
2
answers
1k
views
Chaining tasks with continuation and run parallel task afterward
The work flow of the parallel tasks
I am hoping to get help on the problem I am facing. So the problem is that I am running parallel tasks to search through folders for files. Each task entails ...
4
votes
2
answers
174
views
Why Parallel.For gives only so little gain for this particular function?
I'm having trouble understanding why my "concurrent" implementation of this http://www.codeproject.com/Tips/447938/High-performance-Csharp-byte-array-to-hex-string-t function has only ~20% performance ...
3
votes
1
answer
210
views
Concurrency with TPL in .NET. Parallel Generator blocks after a while and gets stuck
I'm running a game over on CodeGolf.stackexchange.com where players submit bots to compete against one another in the game.
At this stage there's 70 bots and with (N*(N+1))/2 games the tournament is ...
0
votes
1
answer
1k
views
ConcurrentDictionnary tryAdd
When you are using ConcurrentDictionary and trying to add new key pairs to it using TryAdd it checks whether value exists and then add if not. Is there any way I can add duplicate keys wit different ...
53
votes
1
answer
16k
views
Task.WhenAll result ordering
I understand from here that the task execution order for Task.WhenAll is not deterministic but I cannot find any information about result order.
Will the results collection contain the results in the ...
9
votes
5
answers
8k
views
What is the difference in .NET between developing a multithreaded application and parallel programming?
Recently I've read a lot about parallel programming in .NET but I am still confused by contradicting statements over the texts on this subject.
For example, tThe popup (upon pointing a mouse on tag'...
2
votes
5
answers
2k
views
Concurrent download/processing in C#
I'm looking for the fastest and most reliable approach to downloading 1000 remote webpages (using HttpWebRequest) concurrently using C#, writing them to individual local files and running some ...
20
votes
2
answers
24k
views
multiple threads adding elements to one list. why are there always fewer items in the list than expected?
The following code explains my question.
I know the list is not thread safe. But what is the underlying "real" reason of this?
class Program
{
static void Main(string[] args)
{
...
64
votes
6
answers
82k
views
What does MaxDegreeOfParallelism do?
I am using Parallel.ForEach and I am doing some database updates, now without setting MaxDegreeOfParallelism, a dual core processor machine results in SQL client timeouts, where else quad core ...