Re: Strong vs. Normal Thread Safety.
- From: Joe Seigh <jseigh_01@xxxxxxxxxx>
- Date: Wed, 09 May 2007 06:37:45 -0400
frege wrote:
....
The gist of Chris' post is that
- boost::shared_ptr doesn't do this.
- Chris has a smart_ptr that can do this.
That's his point.
Now, my question:
I also have a smart_ptr that can handle this situation, however...
when setting g_foo to the new global:
g_foo = some_other_ref_counted_ptr;
do you (Chris) have a version where some_other_ref_counted_ptr might
also be in the middle of an assignment? In my version,
some_other_ref_counted_ptr has to be 'stable' during the assign (the
refcount can change, but what it points to cannot change).
My use cases always had some_other_ref_counted_ptr being stable, so I
didn't persue it too far, but it would be nice to remove that
limitation.
AFAIK, yes. Everything is atomic. You will either see the new value
of the source ptr or the old value.
Should even handle
g_foo = g_foo;
while
g_bar = g_foo;
and while
g_foo = g_bar;
are happening all simutaneously. Note that the expressions aren't atomic.
Just the pointer loads and stores.
--
Joe Seigh
When you get lemons, you make lemonade.
When you get hardware, you make software. .
- References:
- Strong vs. Normal Thread Safety.
- From: Chris Thomasson
- Re: Strong vs. Normal Thread Safety.
- From: David Schwartz
- Re: Strong vs. Normal Thread Safety.
- From: Chris Thomasson
- Re: Strong vs. Normal Thread Safety.
- From: David Schwartz
- Re: Strong vs. Normal Thread Safety.
- From: Chris Thomasson
- Re: Strong vs. Normal Thread Safety.
- From: Chris Thomasson
- Re: Strong vs. Normal Thread Safety.
- From: David Schwartz
- Re: Strong vs. Normal Thread Safety.
- From: Chris Thomasson
- Re: Strong vs. Normal Thread Safety.
- From: Chris Thomasson
- Re: Strong vs. Normal Thread Safety.
- From: David Schwartz
- Re: Strong vs. Normal Thread Safety.
- From: Chris Thomasson
- Re: Strong vs. Normal Thread Safety.
- From: David Schwartz
- Re: Strong vs. Normal Thread Safety.
- From: Chris Thomasson
- Re: Strong vs. Normal Thread Safety.
- From: David Schwartz
- Re: Strong vs. Normal Thread Safety.
- From: Chris Thomasson
- Re: Strong vs. Normal Thread Safety.
- From: frege
- Strong vs. Normal Thread Safety.
- Prev by Date: Urgent : How to know context switch has occurred or not using VC++
- Next by Date: Re: Urgent : How to know context switch has occurred or not using VC++
- Previous by thread: Re: Strong vs. Normal Thread Safety.
- Next by thread: Re: Strong vs. Normal Thread Safety.
- Index(es):
Relevant Pages
|