Explain the thread local storage (tls), Operating System

Explain the Thread Local Storage (TLS)   

Windows NT provides unique functions for per-thread data management. Thread local storage (TLS) is a concept defined in NT so developers can manage global data independently for each thread. Generally, a mechanism is provided for setting and getting the thread local storage for each thread. Upon process or DLL initialization thread local storage must be initializes via the TlsAllocFunction. This process allocates a TLS table and returns a TLS index that is used with all other TLS functions.

Once initialized, each subsequently created thread would typically allocate memory and save the memory pointer on a per-thread basis. TlsSetValue( ) is used to associate a data pointer with the calling thread. Subsequent access to that thread data would be available via the TlsGetValue( ) function call. When all threads are done with per-thread data management, TlsFree( ) should be issued to release the TLS index.

 

Posted Date: 5/29/2013 5:51:45 AM | Location : United States







Related Discussions:- Explain the thread local storage (tls), Assignment Help, Ask Question on Explain the thread local storage (tls), Get Answer, Expert's Help, Explain the thread local storage (tls) Discussions

Write discussion on Explain the thread local storage (tls)
Your posts are moderated
Related Questions
Scalability : Scalability is the competence of the system to adapt to increased service load. A scalable system will respond more gracefully to increased load than a non-sc

Allocators can also be used to avoid problems with unsafe languages. C and C++ are pervasive, with huge amounts of existing code. They are also memory-unsafe languages, in that the


What is operating system?

How can a user program disturb the normal operation of the system? a) Issuing illegal I/O operation. b) By accessing memory locations within the OS itself. c) Refusing to

What are turnaround time and response time? Turnaround time is the interval among the submission of a job and its completion. Response time is the interval among submission

What are the functions of virtual file system (VFS)? a. It separates file-system-generic operations from their execution defining a clean VFS interface. It permits transparent

The 5Z Company is selling pens to the local market. It is planning to maximize sales and profit by analyzing few conditions using the break-even analysis formula. Below is the data

How is it different from the unbounded buffer algorithm ? Explain.

The different paging techniques are 1. Multilevel paging or hierarchical paging method: In definite cases the page table may consist up to 1 million entries. This would be