Brief Introduction to Android bionic TLS

Source: Internet
Author: User

What's TLS?

TLS is Thread Local.
Storage. Three types of variables are supported for TLS threads: local variables, local variables (TLS), and global variables. TLS differences: All threads use the same variable name or index
Access TLS variables, but the TLS variables of different threads are stored in different memory regions. In short, it is the same name and different storage.

For example, if there is a TLS variable errno, each thread executes the same statement "errno = I;" and errno has different values under different threads. Note that this does not declare a variable named errno in every thread. This is the convenience of TLS.
.

 

how to enable TLS?


If you wocould like to enable it, kernel config will now get new entry:
config_has_tls_reg = Y

rebuild the kernel and apply patch: 'android-enable-tls.patch '

the attached patch contains the experimental changes to enable TLS in
userspace (Android bionic and frameworks/base ).

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.