Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

clearing TLS

renorm
Beginner
242 Views
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!
0 Kudos
1 Reply
Kirill_R_Intel
Employee
242 Views
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
0 Kudos
Reply