full source code for an atomic reference counting C API...

C

Chris Thomasson

Here are the pre-alpha code downloads:

http://appcore.home.comcast.net/vzoom/refcount/
(both C and C++ api here...)



Here is some pre-alpha documentation:

http://appcore.home.comcast.net/vzoom/refcount/doc/

http://appcore.home.comcast.net/vzdoc/atomic/static-init/


This pointer abstraction is atomically thread-safe... Please note that this
is different than the "current" c++ shared_ptr algorithm. It's not atomic
wrt
strong competing accesses... That is, a thread has to own a reference to a
shared data-structure before it can try to acquire another one. This
restriction does not apply to the prototyped algorithm which allows a
plurality of threads to acquire a plurality of references to shared
data-objects that they do not own. The prototype code can also be used to
create a lock-free auto_ptr implementation. I promise to show how to do
it... Well, it involves the following function:

http://appcore.home.comcast.net/vzoom/refcount/doc/api/refcount_add_swap_weak.htm

The 'addend' can be zero, which means that you can effectively transfer
ownership of a shared object; exactly like auto_ptr semantics... Please
note, since the addend is zero, your not using reference counting at all;
auto_ptr doesn't require counting algorithms either..



Any thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top