Are smart pointers threadsafe?

uj
Total Points:
1,350
Status Points:
0
Brown Belt
May 5, 2008 1:53 AM PDT
Rate
 
#2 Reply to #1

Raf_Schietekat:

The reference says shared_ptr offers the same thread-safety as built-in types. I've interpreted this as they're like integers for example which need to be updated in atomic operations if they're shared among threads and simultaneously read and written. This is why TBB offers atomic<T> isn't it?

Well, I may be wrong but I don't think shared_ptr is "atomic". Could someone please shed some light on this.

 



Intel Software Network Forums Statistics

8473 users have contributed to 31605 threads and 100654 posts to date.
In the past 24 hours, we have 30 new thread(s) 110 new posts(s), and 160 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member Kevin Johnson