6 Sep
2009
6 Sep
'09
12:25 a.m.
On Fri, Sep 4, 2009 at 1:36 PM, John Dlugosz
can you point to anything that the boost shared_ptr does that is unsafe in the one-writer-multiple-reader case?
Just looking at the header, I see two direct members, px and pn. So straight assignment isn't going to copy the struct in one atomic operation.
Actually you could. Atomic CAS instructions support up to 64bits on a 32bit platform, and 128bits on a 64bit platform. As long as those are aligned and side-by-side, you can change both atomically. Although Boost does not currently do this.