JVM thread status, Park, wait, sleep, interrupt, yeild vs.

Source: Internet
Author: User

---restore content starts---

JVM Thread State

NEWRUNNABLEBLOCKEDWAITINGTIMED_WAITING,TERMINATED

Blocked is waiting to get the object lock

Waiting is called by wait, Sleep, park

Operating system thread state

Sleep, enter the timed_waiting state, do not sell the lock

Wait, enter the timed_waiting state, assign the lock, and enter the waiting queue for the object

Park, enter waiting state, compare wait do not need to get lock to let thread waiting, wake through Unpark

Interrupt, just send a signal to the thread, and if you wait, sleep will receive exception

Yeild, the thread from running to ready state at the operating system level, waiting to be dispatched. In the JVM's thread state or runnable

JVM thread status, Park, wait, sleep, interrupt, yeild vs.

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.