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

Using enumerable_thread_specific for classes

ypoissant
Beginner
129 Views
Hi there,

Are there any restrictions for using enumerable_thread_specific fo a class that not only holds data but also have methods that may be called to do some work on that data?

Yves
0 Kudos
1 Reply
ARCH_R_Intel
Employee
129 Views
That should work without any problem unless the methods defeat the point of thread-specific storage.

E.g., I can imagine getting into trouble if one of the methods passes "this" (or an address of a member) in a way that lets another thread access the object.
Reply