Let me summarize that for any program, we first need to know whether it will run in a multithreaded environment or whether a variable will be shared by multiple threads at the same time. If so, you need to consider the issue of thread safety.
Let me summarize that for any program, we first need to know whether it will run in a multithreaded environment or whether a variable will be shared by multiple threads at the same time. If so, you need to consider the issue of thread safety.
you can take a look at the design of the rust language
Previous: How else can this code be simplified?