clearing TLS

clearing TLS

How TLS local copies are re-created after calling clear method? Default constructed or copy constructed from the exemplar?

Also, can TLS hurt scalability? Say, does TLS overhead increases as more threads are used?

Thank you!

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The clear method of the enumerable_thread_specific class destroys objects. After this they are created again the same way as new ones. It's up to you what construction way to use: default or with examplar, just the same as when objects are initially created.

There shouldn't be hurt on scalability. There can be some effect on many threads, but not really significant.

Regards,
Kirill

Leave a Comment

Please sign in to add a comment. Not a member? Join today