Skip to main content

All Questions

Filter by
Sorted by
Tagged with
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 ...
Bobby Jose's user avatar
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 ...
brendan3900's user avatar
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 ...
user584018's user avatar
  • 11.4k
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 = ...
NikitaSatcik's user avatar
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, ...
makerofthings7's user avatar
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 = ...
Shumii's user avatar
  • 4,581
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 ...
P0ppy's user avatar
  • 39
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 ...
ristiisa's user avatar
  • 101
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 ...
Eoin Campbell's user avatar
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 ...
Eimantas Baigys's user avatar
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 ...
user3552661's user avatar
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'...
Fulproof's user avatar
  • 4,646
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 ...
Nick's user avatar
  • 1,424
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) { ...
Cui Pengfei 崔鹏飞's user avatar
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 ...
Akash Kava's user avatar

15 30 50 per page