refcount - "mostly" lock-free word-based atomic reference counting



Bug Reports!!! DOH!

Low-Level Abstraction C++ API/ABI (System)

refcount-sys.hpp - (BUG-FIX #1): in vzsync::sys::ptr_base fixed. Re-Download! Sorry!
- I found a killed (BUG-FIX #1): It only existed in the C++ Abstraction API. It had to do with the fact that pointers to user objects were contained in the vzsync::sys::userstate::m_state member. I was returning a pointer to the vzsync::sys::userstate itself, rather than the vzsync::sys::userstate::m_state member!


Intel IA-32 Low-Level Abstraction C API/ABI (System)

spinlock-ia32.h - (BUG-FIX #2): in global table was declared static! ;^(.... Re-Download.
spinlock-ia32.c - (BUG-FIX #2): new translation unit added.
- I found a killed (BUG-FIX #2): It only existed in the Low-Level IA-32 Abstraction C API/ABI. It had to do with the fact that the g_spinlock_ia32_table_mem, g_spinlock_ia32_table global variables and the spinlock_ia32_libinit(void) function were declared static. These dosenít work well with multiple translation units; you can get multiple copies of the table per-process. I added the 'spinlock-ia32.c' file to the library in order to keep a global copy of the locking table. Of course, this particular bug didn't show up before because all of my initial test applications only consisted of a single translation unit!




Reference Materal

Atomic Reference Counting C API (User)

Atomic Reference Counting C API (User) Documentation



Source Code

Intel IA-32 Assembly Language Based C API/ABI (System)

refcount-ia32-masm.asm - Microsoft Macro Assembler
refcount-ia32-mingw.asm - Minimalist GCC For Windows
refcount-ia32-gcc.asm - GCC For IA-32 Based Operating Systems


Intel IA-32 Low-Level Abstraction C API/ABI (System)

spinlock-ia32.h - Hashed Spinlock Synchronization
spinlock-ia32.c - Hashed Spinlock Synchronization
refcount-ia32.h - Atomic Reference Counting Synchronization


Low-Level Abstraction C++ API/ABI (System)

refcount-sys.hpp - Wraps refcount.h


High-Level Abstraction C++ API (User)

refcount.hpp - Wraps refcount-sys.hpp


Miscellaneous C API (User)

helper.h - Basic Helper Macros


Atomic Reference Counting C API (User)

refcount.h - Atomic Reference Counting Synchronization



Downloads

refcount-ia32-0-0-0-1.zip - refcount Library For The Intel IA-32 (Pre-Alpha)
refcount-ia32-0-0-0-2.zip - Updated refcount Library w/ C++ Abstraction (Pre-Alpha)





Chris Thomasson

http://appcore.home.comcast.net/
(portable lock-free data-structures)