Multithreading--The running state of threads (interview questions)

Source: Internet
Author: User

The start of a thread is using the start () method, but it does not mean that the Start method is invoked to initiate multithreading immediately.

Thread Transition Status:

When multithreading calls the Start () method, it does not execute immediately, but instead enters the ready state, waiting for the schedule to execute. Scheduling is the need to assign resources to programs to run before you can execute code in multiple threads (code in run). But this program is not always executed, after a period of execution, it is necessary to give up resources to allow other threads to continue execution. That is, the run method may not have finished executing, probably only half done, then the time to give up the resources, then to re-enter the ready state, waiting for the allocation of new resources, and then continue to execute. When the thread finishes executing, it will not enter the terminating state.

Multithreading--The running state of threads (interview questions)

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.