I have billions of records and i have to do some long calculation on those records. If I am using a sequential for loop then it takes around 7hr to complete that task which is not affordable. To overcome with this, I'm using Parallel.For but the catch is concurrency is occurred in jobs.
Example -
1. Run Parallel.For on 10 records, it creates 10 threads for each record.
2. While executions, First Thread is done with all the calculation and clear the data.
3. Here Second or Reaming Threads getting error in the calculation says - data in not available
How can we resolve this concurrency probleam?
The ultimate goal of my code is to create a new instance for that record and run separately in these block and should not affect the others.


sahana radder14 reputationPosted Nov 29, 2016, 12:21 AM EST
Hi Anurag,
Regards - Sahana
Andres Gomez4 reputationPosted Dec 28, 2016, 4:01 AM EST
Sujeet Singh135 reputationPosted May 30, 2017, 12:59 AM EDT
Hi Anurag,
I think I have got you question, so solution for the same may be...
Benjamin Scharbach20 reputationPosted Oct 14, 2017, 9:22 AM EDT