Talk about Java Multithreading (interview)

Source: Internet
Author: User
The purpose of multithreading is to maximize the utilization of CPU resources. Java writers run in the Java Virtual Machine (JVM), and within the JVM, the multitasking of the program is done through threads. Starting a Java application with Java commands starts a JVM process. In the same JVM process, there is only one process, which is itself. In this JVM environment, all program code runs as threads. A Java virtual machine allows an application to run multiple execution threads concurrently. The Java language provides extensibility points for multithreaded programming and gives a powerful threading control API. In Java, there are two ways to implement multithreading: extending the Java.lang.Thread class to implement the Java.lang.Runnable interface Java Multi-Threading disadvantage: 1, Java data Synchronization is achieved through synchronized, But basically to the virtual machine to complete, 2, the Java Multi-threaded run method does not return a value, so how to get the child thread feedback information, it really makes a headache.

Talk about Java Multithreading (interview)

Related Article

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.