Java Thread Safety issues (NET 360)

Source: Internet
Author: User
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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.