I need to develop a procedure that will retrieve 100 rows (product items) performing some very complex calculations. On average, 0.3s is required for each item, which means that I may face 30s delay if I perform the calculation in serial. The calculation for each item is not depended on the result of the other items, so I am thinking to use c# asynchronous programming features in order to create threads that will make the calculations in parallel.
The above calculation will be performed in a ASP.NET Core app (.Net 6) that will serve about 10 users.
Until now, I used asynchronous programming for the purposes of keeping the main thread responsive, so I had no worries about system resources. Now I have to design a procedure that may require 100 x 10 = 1000 threads.
Keep in mind that the calculations are performed in the database, so calculation does not require any additional resources.
Should I do it?