When you want to run more than one of the same methods with task processing

Asked 2 years ago, Updated 2 years ago, 130 views

Thank you for your help.
If you want to run multiple tasks for a class of methods, use the new instance of the class and
Should I run multiple tasks?
Or should I use the new class and method for each task?
It's a simple story that you don't have to consider the use or convenience of any of the variables in the class.

Thank you for your cooperation.

c# .net multi-threaded

2022-09-30 18:51

2 Answers

If you don't have to consider anything, it's simple to run multiple tasks in one instance.

It remains to be seen whether such tasks alone can produce practical applications.(Well, I don't think that's necessary.)


2022-09-30 18:51

How to use the variables in the class

This is usually the most important decision point, and you decide whether or not to use one instance by checking whether the "instance member" is "thread safe" in references such as MSDN.


2022-09-30 18:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.