Re: race on multi-processor solaris
From: Gavin Maltby (G_a_v_i_n.M_a_l_t_b_y_at_sun.com)
Date: 11/14/03
- Next message: Greg Mortensen: "Re: Hardening a Solaris system."
- Previous message: Nick Maclaren: "Re: Hardening a Solaris system."
- In reply to: Joe Seigh: "Re: race on multi-processor solaris"
- Next in thread: Joe Seigh: "Re: race on multi-processor solaris"
- Reply: Joe Seigh: "Re: race on multi-processor solaris"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 14 Nov 2003 16:37:28 +0000
Joe Seigh wrote:
>>Well, there's a bit of "atomic reference counting" going on in
>>Solaris.
>
>
> Really? Atomic as opposed to merely thread-safe? Detlefs seems to
> think it's impossible without DCAS. Boost shared_ptr is thread-safe,
> not atomic. Java ptrs are atomic. You get valid values no matter how
> you use them. In C++ that means no invalid values which could cause
> a segfault.
I'm not certain we're singing from the same glossary sheet here.
I'd call an "atomic reference count" a successful inc/dec made to a counter
using CAS, along these lines:
do {
old = *addr;
new = old + 1;
while (cas(addr, old, new) fails);
Nothing to do with threads or thread safety there.
Gavin
- Next message: Greg Mortensen: "Re: Hardening a Solaris system."
- Previous message: Nick Maclaren: "Re: Hardening a Solaris system."
- In reply to: Joe Seigh: "Re: race on multi-processor solaris"
- Next in thread: Joe Seigh: "Re: race on multi-processor solaris"
- Reply: Joe Seigh: "Re: race on multi-processor solaris"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|