PE format eighth, TLS table (thread-local storage)IbinarySource: http://www.cnblogs.com/iBinary/All rights reserved, welcome to keep the original link to reprint:)I. Review thread-related knowledgeThe first time to explain the TLS, you need to
Windows TLS (thread local storage)I. TLS description and classificationWe know that in a process, all threads are sharing the same address space. So, if a variable is global or static, then all threads are accessing the same part, and if one thread
Thread-local Storage (TLS)2011-10-11 09:59:28| Category: Win32---API | Tags: TLS | report | Font SubscriptionWhat is thread-local storageAs we all know, a thread is a unit of execution, and multiple threads in the same process share the address
The special thing about TLS is that the program's entry point EP is not the first instruction to execute, so it is often used for anti-debug detection.Use an already open TLS program to do the instructions.DataTLS exists in the PE file format. The
1. Reasons for using thread-local storageWhen we want the global variables of this process to become thread-private, instead of shared by all threads, that is, when each thread has a copy, the thread-local storage (tls,thread local Storage)
Note:
A. this article describes the brief Implementation of the Linux nptl thread stack and the principle of local thread storage. In the experimental environment, the Linux kernel version is 2.6.32, the glibc version is 2.12.1, And the Linux
1 Introduction to TLS technologyThread Local Storage (TLS) is a mechanism that Windows provides to address the simultaneous access of multiple threads in a process to global variables. TLS can simply be done by the operating system on its behalf to
The earliest time was when a timer (timer_create), The first time this timer is triggered, it will cause the program core to fall, and the core location is also not fixed. Valgrind can be used to find memory write errors:
==31676== Invalid write of
Local thread storage TLS
The local variables defined in the stack are safe for multithreading because different threads have their own stacks. Generally, the defined global variables can be read and written by all threads, so that they are not
Simple analysis and use of Thread Local Storage (TLS)
In multi-threaded programming, if multiple threads need to share access to the same variable, the variable can be declared using the keyword volatile. If a variable does not want to share
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.