Java thread-related methods detailed parsing _java

Source: Internet
Author: User

Start () boot thread method

When run () invokes the Start () method, the method body of the method is actually executed

Sleep () wakes the current thread, sleeps automatically, and enters the operational state rather than the running state

Yield () pauses the currently executing thread object, and the JVM thread scheduler invokes other high-priority threads based on the preemptive mechanism of precedence, with a priority range of 1 (thread.min_priority)--(thread.max_priority), The Create thread defaults to 5 (norm_priority)

setpriority (int newpriority) Set the priority of the line threading

Join () waits for the thread to terminate before it starts executing the current thread, such as the Join () method that invokes thread B in thread A, waits for thread B to terminate before continuing thread A, thread B execution terminates, and thread A enters the operational state.

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.