Links-loading-Libraries, reading notes

Source: Internet
Author: User

Threads can visit all the data in the process memory, even the stack of other threads (if it knows the thread's stack address, rarely), but the actual use of the threads also has its own private storage space:

1, stack (although not completely inaccessible by other threads, it can still be considered private data in general)

2, the thread Local storage solution (thread local storage). Thread-local storage is a private space that some OSes provide separately for a thread, but usually has only a limited amount of capacity.

3,register (including PC registers), the register is the level data that executes the stream, which is private to the thread.

=

From the point of view of the C programmer, whether the data thread is private is as follows:

Shared between thread private threads (process-owned)

Local Variables Global variables

Data on the parameter heap of the function

The static in the TLS data function

program code, any thread has the right to read and execute any code

Open files, a thread open files can be read and written by the B thread

========

Thread scheduling is total, and threads usually have three states to know, namely:

Running: the thread is executing

Ready: The thread can now execute, but the CPU and the occupied

Wait: At this point the thread waits for an event to occur and cannot be executed.

Links-loading-Libraries, reading notes

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.