RE: [reSIProcate] Reference Counting Smart Pointer
The windows condition implementation (within WIN32_CONFORMANCE_TO_POSIX
defines) is from Boost. It was ported over by Ken H.
-----Original Message-----
From: kaiduan xie [mailto:kaiduanx@xxxxxxxx]
Sent: Friday, May 27, 2005 2:51 AM
To: Scott Godin; resiprocate-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [reSIProcate] Reference Counting Smart Pointer
Scott,
Can you explain in more details why you borrow some
code in Condition.cxx from Boost instead of from ACE?
My current version is borrwoing some code from ACE.
Any pointer is appreicated.
Thanks,
kaiduan
--- Scott Godin <slgodin@xxxxxxxxxxxx> wrote:
> The desire to use a smart pointer is not for
> performance gains - it is to
> easy the memory management burden of the application
> (for now - just for
> UserProfile management).
>
> There is a mutex to guard the counter logic. For
> more info - check out:
>
> http://www.boost.org/libs/smart_ptr/shared_ptr.htm
>
> Here is a cut-and-paste of the thread safety
> section:
>
> Thread Safety
> shared_ptr objects offer the same level of thread
> safety as built-in types.
> A shared_ptr instance can be "read" (accessed using
> only const operations)
> simultaneously by multiple threads. Different
> shared_ptr instances can be
> "written to" (accessed using mutable operations such
> as operator= or reset)
> simultaneosly by multiple threads (even when these
> instances are copies, and
> share the same reference count underneath.)
>
> Any other simultaneous accesses result in undefined
> behavior.
> ....
>
>
> -----Original Message-----
> From: kaiduan xie [mailto:kaiduanx@xxxxxxxx]
> Sent: Thursday, May 26, 2005 4:27 PM
> To: Scott Godin;
> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [reSIProcate] Reference Counting Smart
> Pointer
>
> Will the smart pointer be used in multiple-thread
> environment? If yes, you may need to add mutex to
> serialize its access. But the overhead of
> serializing
> operation may over-counter the performance brought
> from shared pointer.
>
> In VOVIDA, it used a lot of smarter pointer. But in
> resiprocate, the smarter pointer was totally
> removed.
> Any anyone explain the reason?
>
> kaiduan
>
>
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca