Tell you with your personal experience that in your concurrent program code block, it is best not to have a reference type.
I will tell you through my personal experience that in your concurrent program code block, it is best not to have a reference type, and the necessary string type is still acceptable.
At present, I am putting the concurrent programs I wrote some time ago into my project to improve the speed. Because my project is connected to mobile, after asking whether the mobile interface can respond to high concurrency and getting a positive response, I started to design the demo, but there were always errors and problems. Later I thought, this may be a problem with the reference type, because my concurrent code needs to constantly assign values to a field of a class instance object and then call the Mobile Interface, I will be wondering, it may be because the concurrency is too fast, and the memory address is not changed after the reference type value is assigned, because the class instance object is global, later, I changed it to a local one. Is it too big to change the memory? I prefer speed and speed, and sure enough! Running successful, no error.
Finally, I figured out that the value type in concurrency is the safest. Of course, sometimes we still need a string. In this case, we 'd better make the string a local variable, and the rest of the reference types are also, we can think of the reference parameter required for a concurrent request as a request. The big deal is that each request Call uses a local variable and consumes much memory. Besides, we can also manually release the memory ourselves!