Explain the thread local storage (tls), Operating System

Assignment Help:

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.

 


Related Discussions:- Explain the thread local storage (tls)

What are the methods for handling deadlocks, What are the methods for handl...

What are the methods for handling deadlocks? The deadlock problem can be dealt with in one of the three ways: a. Use a protocol to prevent or avoid deadlocks, ensuring that

Explain the entry-sequenced file organization, Entry-sequenced file organiz...

Entry-sequenced file organization The records in an entry-sequenced file are store up in the order they are written into the file. New records are for all time appended to

Banker''s algorithm, Consider the following snapshot of a system, answer th...

Consider the following snapshot of a system, answer the following questions using the banker's algorithm: 1. What is the content of the matrix Need? Is the system in a safe stat

Deadlock resoloution technique, justify the role played by the operating sy...

justify the role played by the operating system in managing the process to avoid deadlock

Why global variables are unacceptable, Why Global variables are unacceptabl...

Why Global variables are unacceptable Global variable, for instance, are unacceptable because they break the rules of self - containment. If all procedural components are runni

Demand paging, Demand paging gives that pages could only be brought into ...

Demand paging gives that pages could only be brought into memory if the running process acts them. This is usually referred to as lazy evaluation as only those pages operated by

Explain first fit allocation algorithm, Describe the following allocation a...

Describe the following allocation algorithms: a. First fit b. Best fit c. Worst fit   a. First-fit: search the list of available memory and all

Explain important fuction of virtual file system, Virtual File System serve...

Virtual File System serves two important functions. 1. It divides file-system-generic operations from their execution by defining a clean VFS interface. 2. The VFS is based

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd