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

Using enumerable_thread_specific for classes

ypoissant
Beginner
638 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
638 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.
0 Kudos
Reply