Java Multithreading-Thread groups

Source: Internet
Author: User

Java uses Threadgroup to represent thread groups, which are used to classify a batch of threads.

  • Java allows the program to control the thread group directly, the control of the thread group is equivalent to control this batch of threads;
  • All threads created by the user belong to the specified thread group, and if the program does not explicitly specify which thread group the thread belongs to, the thread belongs to the default thread group;
  • By default, a child thread is in the same thread group as the parent thread that created it;
  • Once a thread has joined the specified thread group, the thread will always belong to that thread group until the thread dies and the thread cannot change the thread group it belongs to.

A more useful method is defined in Threadgroup: void uncaughtexception (Thread T, Throwable e), which can handle unhandled exceptions thrown in the thread group.

Java Multithreading-Thread groups

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.