What is the meaning of single-threaded and multithreaded in Java, and what is the difference between them, and what is the role of the distinction?
In a program, these stand-alone program fragments are called "threads", and the concept of programming with it is known as "multithreading." A common example of multithreaded processing is the user interface. With threads, the user presses a button, and the program responds immediately, rather than having the user wait for the program to complete the current task before it starts responding. In short, it means that you can have multiple tasks at the same time. Single-threaded when the program executes, the path of the program is in sequential order, the front must be handled well, the latter will be executed. Therefore, for the example above, you must wait for the program to complete the current task before you can begin the corresponding. Using multithreading to access public resources is prone to thread-safety issues, so use the thread synchronization mechanism to protect public resources against this need. Single thread More threads say, there will be no appeal issues, system stability, scalability, software rich. More for point-to-point services.
Java Thread Safety issues (NET 360)