Java-Preliminary Understanding-12th Chapter-Multithreading Overview

Source: Internet
Author: User

One.

Now learn a new technology that is supported in Java.

Learn about threads before you understand multithreading. Understand the process before you know the thread.

When we execute a program, it opens up space in memory if it is started. This space is the process. The process corresponds to the space that an application has in memory.

A program that opens up space in the middle of it means that it is running, not running, and it is going to free up space. The hard disk is stored, the memory is temporarily stored, and it is stored at run time.

The specifics of any one application are loaded as they are to be run. This program loads into memory and executes from the portal. For example, start from the top down, which is called the program's execution path.

So how does this program work? This entire region is called a process, and the process is not executed directly. It is just allocating the memory space of the application, who is responsible for executing it? is the thread. is the thread, which is the control unit responsible for the execution of content in the process, also called the execution path, also known as the execution scenario.

Can there be no threads in a process? Impossible, the space to open up, to run the code is here, no content to help you execute, the program will not run up.

Known as the execution path, it feels more unfamiliar.

See, not only the left in the execution, the right is also executing, while in operation, this is multithreaded, there are multiple execution paths at the same time running.

The presence of a thread can be responsible for program execution. That is, a thread is to execute a part of the code, why do we make more of a thread? To be able to execute part of the code at the same time, that's the thing.

Threads usually have corresponding content, which is called a task.

The thread is created to perform the task.

Java-Preliminary Understanding-12th Chapter-Multithreading Overview

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.