Reference namespaces
Using System.Threading.Tasks;
1. Simultaneous execution of multiple methods of complementarity impact
Parallel.Invoke (() =
{
Method one;
}, () =
{
Method two;
}......);
2. Batch execution of loops in foreach
foreach (DataRow dr in Dt. Rows)
{}
Use the following multithreading
ienumerable<datarow> rows =dt. Rows.cast<datarow> ();
Parallel.foreach<datarow> (rows, new ParallelOptions {maxdegreeofparallelism = 8}, Dr =
{
});
If you think reading this blog gives you something to gain, just click on the " recommend " button in the lower right corner.
If you want to find my new blog more easily, click on " follow Lingyun " in the lower right corner.
Because, my writing enthusiasm also inseparable from your affirmation support.
Thank you for your reading, if you are interested in the content of my blog, please keep following my follow-up blog, I am Lingyun.
Multithreading Synchronous execution