6
votes
1answer
897 views

How to parallelize a Data-Driven unit test in Visual Studio 2010?

I know regular ms-test unit tests can be parallelized on a multi-core machine (with caveats of course) by specifying parallelTestCount attribute in the .testresults file in the test solution. Like ...
3
votes
1answer
38 views

How do I run MSpec test assemblies in parallel?

We have the following setup: Team City v8.1.2 .NET 2013 Solution with several different C# projects (ASP.NET MVC, libraries, testing projects, etc.) 95% of our tests are MSpec, but we also have some ...
2
votes
1answer
60 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 ...
2
votes
1answer
202 views

C# - Parallel For loops: Parallel.For(); - How do they work with variables declared outside of them?

I have the following code: string someVariable; Parallel.For(0, maxCount, count => { Parallel.For(0, dimension, row => { Parallel.For(0, dimension, col => { ...
2
votes
1answer
623 views

Run parallel build of Microsoft.Build.Evaluation.Project from C#

Good morning. Please help me with msbuild. I have many loaded csproj in array of Microsoft.Build.Evaluation.Project. I changed same properties in projects. How run parallel build of my projects? ...
2
votes
1answer
377 views

asp.net asynchronously execute the tasks and update UI

I am developing an asp.net application which will discover UDP clients available on LAN. I need to update UI control(where the discovered devices will be displayed) and progress bar at the bottom. ...
1
vote
1answer
72 views

Multiple HttpWebRequest with POST at the same time

I am trying to send the POST requests to the web server, they all have to be done at the same time.I've made the code below, but it's sending the requests about 4 per second. For example, if I want to ...
2
votes
0answers
47 views

Run unit tests parallel and then integration tests sequentially

I'm wondering how i could run my unit tests in parallel and my integration tests normally. Consider the following scenario: I have two projects, one for my unit tests and one for my scenario tests. ...
2
votes
0answers
150 views

Windows Service with Parallel Task - stopping service gracefully

This is a follow-up from my previous question here: Writing a sync application using Windows Service to process files in Parallel I've got the timing and processing correctly setup exactly as I want. ...
2
votes
0answers
2k views

How to fix a System.AggregateException when using Parallel.For loops in C#

I have a loop in C# that looks like this: for (int level = 0; level < numLevels; level++){ for (int y = 0; y < ysize; y++){ for (int x = 0; x < xsize; x++){ ...
1
vote
0answers
102 views

Parallel.ForEach and DbContext

I'm using Parallel.ForEach and it's hugely improving the performance of my code, but I'm curious about DbContext with multiple threads. I know it's not thread safe so I'm using locks where I need to. ...
1
vote
0answers
102 views

Could not create SSL/TLS secure channel in parallel GetObject S3

I want to download files from S3 in parallel. When I do it non-parallel it works well, but when I tried to change my code to work in parallel (Parallel.For, Task, etc), it always failed with the ...
1
vote
0answers
130 views

Parallel Tasking Implementation C# - Bidding Application

I am a beginner doing an internship. They give me a bidding program to implement. In brief , the application starts by adding the items (ItemName , ItemPrice , OwnerName) , after that the bidding ...
1
vote
0answers
120 views

Parallel.Foreach - last item waits for other items

I've written a parellel.foreach, but the last iteration allways waits for execution before all other items have been processed, in this case, number 10 fires only when 1-9 are ready, tried it a couple ...
1
vote
0answers
59 views

EF 5 usage in a heavily parallel desktop application

I have a desktop application using Entity Framework 5 that processes multiple videos in parallel, where each thread contains multiple child threads to accommodate multiple pass processing. Although ...
1
vote
0answers
81 views

Lost transaction in parallel threads

I need to insert some lines in database and if lines contain errors - all changes need to rollback. I was thinking to use Parallel class. Here is my code class Program { static void Main(string[] ...
1
vote
0answers
198 views

Cannot find bug in C# 4.0 Parallel.For loop using thread-specific variables

I am attempting to model slot machine behavior with parallel programming, using a base class (SlotBase) which will be overridden by classes representing each individual machine. In the base class, I ...
1
vote
0answers
189 views

Parallel.For with raster image processing

I want to speed my code up. I'd like that snippet to work faster. I tried to create my own Parallel.For implementation of the loop, but I failed. No errors, but tifDS seems to be empty:/ Could any1 ...
1
vote
0answers
636 views

Is this the correct way to process a large dataset?

I am tasked with rewriting our internal conversion software from vb6 to C# .net 4. The software will take a data source (it could be a flat file, mySQL, MS SQL, Access) and put it in to our MS SQL ...
0
votes
0answers
34 views

SQL Server CLR UDF Parallelism redux

I have been researching SQL Server CLR UDFs and parallelism for some time. The general consensus seems to be that in SQL Server 2008 and later, a scalar value CLR UDF with DataAccessKind.None should ...
0
votes
0answers
34 views

Switching to Parallel.For (from a sequencial for)

I'm changing my code to use a Parallel.For instead of a simple for statement. My code have 3 nested for to make a comparison pixel-by-pixel of two images. In the last for I save the cut points ...
0
votes
0answers
40 views

Should i stop my Tasks?

Good day! I try to parallel my little example prog- for each 3600 iterations i create Task and starts it. Should i stop it someway? class Program { static void Main(string[] args) { ...
0
votes
0answers
22 views

Retrieving information about the testsettings file in visual studio

Tests written using the Visual Studio Unit Testing Framework usually run using definitions from a .testsettings file. I was wondering whether it is possible to directly access properties of the ...
0
votes
0answers
35 views

Create subtasks from a task

I am creating several tasks, each one of them we'll take care of a class instance. In every instance I have to perform some SQL read and then push the data in CRM. The code that creates the task is ...
0
votes
0answers
59 views

Avoiding race condition - Parallel programing

I'm using this function [makeComputerMove] with the Task.Factory.StartNew statement to avoid UI freeze in my WPF application. I'm calling this function from a while loop and I believe I have a race ...
0
votes
0answers
33 views

Linq to SQL and multi CPU performances

I have a question about processors performances and multithreading with Linq to Sql. Considering the following simple code which is selecting items from a table to create new entries in a seconde ...
0
votes
0answers
58 views

Does the SoapHttpClientProtocol use the ServicePointManager.DefaultConnectionLimit for limiting host connections?

I'm connecting to a webservice, and I need to make 400 calls to it at once. I want to do something like the example below, but I'm not sure if SOAP uses the ServicePointManager. const int ...
0
votes
0answers
40 views

Connecting to a Network share with credentials… in parallel

I'm trying to copy files from a Windows system to a Samba share. Multiple processes copying different files are supposed to be running in parallel. There is a very nice solution here. However, no ...
0
votes
0answers
45 views

Prioritizing a Task in high concurrent image processing (prevent stacking)

Is there an option in C# to give a priority for Tasks that ran first. I am using a code for image processing. In my testing and in high workload (e.g. 100 concurrent parallel image processing and ...
0
votes
0answers
57 views

Optimal algorithm for parallel html loading using HttpClient in .NET

This is mostly theoretical question. My goal is to load list of URLs using list of proxies as fast as possible. I've got an array of URL's, an array of WebProxies. My idea is to create a task for each ...
0
votes
0answers
108 views

Method for inserting data with thread safety.. static or new class?

I want to use parallel for inserting data into MySQL. Class Database { ... public static void insert(string line) { try { string query = "INSERT INTO db." + ...
0
votes
0answers
81 views

How can I scatter an object array using MPI.NET

I'm trying to scatter a 2d boxed array. here is the summerized code: using (new MPI.Environment(ref args)) { Intracommunicator comm = Communicator.world; object[] boxedArrays = new ...
0
votes
0answers
80 views

Null values while updating DB in Parallel.Foreach

I use following script to get data from external service and store in dB. In certain rare cases less than 1% records gets updated with null values. In below code, the "re.status=fail" we see null. let ...
0
votes
0answers
39 views

Is there any way to execute stored procedures in parallel in the same SqlTransaction?

I am wondering if there is a way to execute a few stored procedures in parallel in the same SqlTransaction? SqlTransaction "is not guaranteed to be thread safe" (MSDN). What do you think about it?
0
votes
0answers
25 views

TPL Task Parentage Cancel

Two TPL tasks, MethodA and MethodB run as AttachedToParent tasks. MethodA should only run if the args contains some data e.g. args.Criteria.Any() -> MethodB task should always run as it processes ...
0
votes
0answers
45 views

WebClient with Parallel downloads a 0 size file

Here is my code: Task.Factory.StartNew(() => Parallel.ForEach(list, test => { WebClient WClient = new WebClient(); try { string url = "http://some_url.com"; ...
0
votes
0answers
31 views

Cancelling tasks spawned by Parallel.For

I'am writing a simple application which resolves TSP problem. I got few optimization algorithms and my goal is to write a gui applications which runs few algorithm instances in parallel and then ...
0
votes
0answers
134 views

Parallel distribution of a 2D array

I need some advice on parallel workload distribution, based on the heat distribution problem, using the Jocobi method. The program works by splitting a 2D array into 4 equally sized grids, via a ...
0
votes
0answers
42 views

Confusing about how to use the parallel.invoce() on Action[] Array

I am currently working on a project including parallel calculating. I plan to use the parallel.invoke function. I followed the online docs and write down the code below working perfectly: var ...
0
votes
0answers
85 views

Create Task in foreach, pass state object but it still seems to be local C#

I am trying to go through a list of objects and execute a method, Scan(), that modifies an array in the object. I am creating a temporary object to avoid the closing over the loop variable, but I am ...
0
votes
0answers
280 views

Visual C# Appending a Text Box In Parallel For Loop - Cross Threading?

I am new to Visual C#, using Visual Studio. I have some calculations that are done in a parallel for loop, and I want to output something to the output text box inside this loop (keeps all output from ...
0
votes
0answers
523 views

How to program wait Custom MessageBox OK,Cancel,Yes,No responses?

How to program wait Custom MessageBox OK,Cancel,Yes,No responses? i have been using custom messageBox because of my natural language because messagebox has only english ok,yes,no i have found this ...
0
votes
0answers
157 views

Need in depth understating /Example of Task Parallelism to Read data from database/active directory and display them in grid

I have scenario where i am fetching data from active directory and displaying it in the radGrid, but the collection of data is very big in millions, so retrieving it and displaying it in grid ...
0
votes
0answers
82 views

Using IEnumerable<IEnumerable<double>> in parallel

Can someone please direct me how to use IEnumerable<IEnumerable<double>> in parallel / task efficiently. Appreciate your help. public IEnumerable<IEnumerable<int>> ...
0
votes
0answers
367 views

Programs hangs on parallelism, Parallel.ForEach

I am trying to make a program that uses parallel.foreach to find a particular string in files of a particular directory and its sub directories, it works fine for about 90% of the iteration but after ...
0
votes
0answers
179 views

Parallel Pattern, an alternative to setting ThreadPool.SetMinThreads and MaxDegreeOfParallelism

I often find myself running parallel web requests, and find there is a maximum amount of parallel requests the network connection can handle, so set MaxDegreeOfParallelism and run a parallel.for loop, ...
0
votes
0answers
87 views

How to parallelise a loop with a return statement?

I have a written a Bitmap extension method that will search for "this" Bitmap inside another Bitmap and if found will return the Point at which it is found. The algorithm works by searching the rows ...
0
votes
0answers
186 views

Application runs out of memory when started from another application, but not when launched from Visual Studio. Why?

I have this console application that handles pretty much data, more specifically it manipulates large Bitmap objects. When I launch the Console application through Visual Studio, everything works ...
0
votes
0answers
309 views

Parallel loop on TiffBitmapDecoder

I try to use Parallel loop on TiffBitmapDecoder, but I get the error when Encoder save to the file: "The calling thread cannot access this object because a different thread owns it" My code is very ...
0
votes
0answers
456 views

ConcurrentDictionary problem comparing

Today i was doing some tests with the ConcurrentDictionary and Dictionary: class MyTest { public int Row { get; private set; } public int Col { get; private set; } public string Value { ...