0
parallel programming
I have a table contains 1000+ records and inside there is one column which has records of proc call and all those records needs to be executed in parallel. The procedure performs DML operations along with some complex logic using temp tables. So how can we implement a .NET code using TPL to run those 1000+ records in parallel in such way that no one thread shouldn't lock the resources of an another thread which intern achieves asynchronous operations. Please advice.
1 Antwort
0
You can create a method that will take in each process request and aaynchrnously process each request. You can do this via the async and await keywords where async going in the method signature and await is put at the beginning of the method that handles the processing.
Alternatively you can do Task.Run(() => ProcessingMethod(data));
Mauve this will help you. A quick google search for asynchronously processing data in C# with async and await should yield what you are looking for. Good luck!