Java Advanced feature Series-multithreading

Source: Internet
Author: User

Multithreading Related concepts:

5 states of the thread:

1, new state: After the thread object is created, it enters the new state. Thread thread = new Thread ();

2, Ready State (Runnable): Executable state, after the thread object is created, the other thread invokes the object's start () method, and the thread is started. Is in a ready state and can be executed at any time by CPU scheduling.

3, running State (Running): The thread gets to the CPU being executed. A thread can only move from a ready state to a running state, not from another state.

4, blocking State (Blocked): The blocking state is that the thread has abandoned the use of the CPU for some reason and temporarily stopped running. Blocking is divided into three situations:

(a) Wait for blocking: by calling the thread's Wait () method, let the thread wait for the completion of a work.

(b) Synchronous blocking: threads are getting

Java Advanced feature Series-multithreading

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.