|
-
October 27th, 2010, 10:23 AM
#6
Re: Unique buffer per thread
TLS is a means to an end. It allows DLL's to allocate storage on a per thread basis without formal support from the thread itself.
Or it allows a per-tread equivalent of a 'static' variable without formal support from the thread itself.
The efficient way however is to have the thread manage storage on it's own stack.
This can be regular local scope variables, a local scope pointer to allocated storage (allocated either in the thread, or prior to callign the tread and passed as data).
Due to compiler support TLS can LOOK to be efficient, but there's usually quite a bit of code support hidden behind it.
Of course it depends what you meant by efficient. Efficient in the sense of "fastest running code" or "smallest possible code" then the answer is no.
If you meant "efficient for the programmer since you have to prepare/plan less", then the answer is maybe...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|