Could double-checked locking accidentally happen to work?

jimdempseyatthecove
Total Points:
36,397
Status Points:
36,397
Black Belt
July 7, 2009 11:12 AM PDT
Rate
 
#3 Reply to #2

When you (your program) assume a non-NULL pointer to an object is a pointer to a fully constructed object then it is your obligation (in multi-threaded program) to new/construct to a temporary pointer not visible to other threads. Once constructed then copy pointer to location visible to other threads (copy using CAS in the event that the empty pointer may be going under multiple constructions).

Jim Dempsey

--------

Blog: The Parallel Void


www.quickthreadprogramming.com


Intel Software Network Forums Statistics

8472 users have contributed to 31603 threads and 100652 posts to date.
In the past 24 hours, we have 31 new thread(s) 115 new posts(s), and 163 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 Edwin B. Ramayya