Anatomical java-Concurrent Programming

Source: Internet
Author: User
1. Underlying 1.1 threads for concurrent programming-process/priority

The smallest unit of operating system scheduling is a thread, and the thread is a lightweight process.

The thread priority is set by the setpriority (int) method, which has a default priority of 5 and a rank of 1~10. The higher the grade, the more time slices.

1.2 Status of the thread

New initialization "runable run" "Blocked block" "Wating Wait" "Time_wating timeout Wait" temerinated the end of the state.

1.3 Daemon worker Thread

The worker thread ends after the main thread terminates. Thread.setdaemon (True) to set before thread start.

1.4 Expired Suspend (), resume (), stop () Why is it not recommended?

Suspend () after the call too overbearing, do not release the possession of resources, but holding the possession of resources to sleep, so easy to deadlock. Standing manger don't poop.

Resume (), stop () does not guarantee the normal release of thread resources, how do you use?

Anatomical java-Concurrent Programming

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.