What is thread-safe and how to ensure the security thread

What is thread-safe

Thread-safe multithreaded access the same code does not produce indeterminate results.

How to ensure the security thread

Code for non-safety lock control;

Use thread-safe class;

Multi-threaded concurrency, threads share the variables to the method-level local variables.

Guess you like

Origin www.cnblogs.com/chuanqi1995/p/11492652.html