GC Note--native thread

Source: Internet
Author: User

The native thread cannot directly reference the Access object, so the entire native thread is a GC security Zone (GC safe region), and the native thread can continue execution when the GC occurs.

However, once the native thread invokes the VM interface, the native thread needs to switch state and switch to non-GC security.

For example, invoking the Java JNI interface, the native thread first attempts to switch to the runable state. When switching, check whether the GC has occurred. If it is already in GC, wait for GC to finish, if there is no GC, successfully switched to runable state, blocking GC.

When the call ends, the native thread switches back from the runable state to the native state, returning to the GC security point.

So the native thread (non-VM interface call state) does not respond to the GC and is not blocked by the GC.

The native thread enters the VM interface call, blocking each other from the GC.

GC Note--native thread

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.