Micro-Lock, MurmurHash 3, ...

A quick summary of work done on Rig in the past weeks since the release of 0.4.0:

  • added Micro-Lock, a Mutual Exclusion Lock, based on CAS like MRWLock, with support for ownership checking and recursive locking
  • added MurmurHash 3, the new version of this well known hash algorithm, even faster than its predecessor, especially on older systems
  • Atomic_Ops: added support for the SPARCv9 architecture, as well as support for GCC intrinsics (though the membar situation still needs some work there), and further support for emulating certain atomic primitives using others (there's a graph of how this works)

Posted by Luca Longinotti on 26 Apr 2011 at 22:00
Categories: Rig, C99 Comments



Rig 0.4.0 released

Finally, after years of development, the first release of the Rig library is ready.
Rig started out as a safe strings C99 library, but grew to encompass lock-free data structures and other helpful, multiprocessor oriented features. A quick overview:

  • lock-free stack, queue and ordered list, all with the ability to iterate over them, O(1) size
  • memory is correctly reclaimed through the use of the SMR concept, working correctly in the absence of GC (Garbage Collection is not part of the C language)
  • hashing functions
  • atomic counter
  • thread abstraction (currently supporting POSIX Threads, Win32 Threads will follow)
  • Micro-ReadWrite Lock, a minimal RW-Lock, following the concept of Windows's Slim-RW-Locks, fully based on atomic operations, but also taking advantage of TLS to implement advanced features, like owner-checking
  • string/buffer functions (still incomplete, don't use those yet!)

Focus was set on modularity and reusability, meaning some parts of Rig are segregated and can be used by other projects too:

  • Atomic_Ops: atomic operations headers, providing atomic load, store, add, fetch-and-add, CAS (returning the old value or a boolean), swap and various memory barrier types. All operations expect an explicit memory barrier specification, forcing the programmer to think about them.
    A flag-pointer is also provided, an atomic pointer which uses its last bit to save a boolean flag.
    Modern x86-64 (SSE2 and newer) is the only currently supported architecture, others will follow as soon as I get access to hardware for testing (offers are gladly accepted!).
    This work was inspired by OpenPA.
  • SupportDS: support data structures, non-multi-threading-safe, currently there's a hybrid stack.
  • System Includes: a series of headers to parse the predefined macros on your system to discover things like which OS, which compiler, which libc and which architecture you're running on, to influence compilation, and define a few other features in an as portable way as possible, like TLS support or alignment specification.
    This work was inspired by predef.

Rig currently requires GCC and Cmake to compile, as well as the PThreads library.
It can be downloaded here, and following is its SHA256 checksum:
SHA256 0e95e7c643631f378b46c4b9c948f59b48927d5b249e7bb885623a7491ad45ba rig-0.4.0.tar.bz2

Posted by Luca Longinotti on 10 Apr 2011 at 21:20
Categories: Rig, C99 Comments



Within Temptation @ Zürich

The new Within Temptation album "The Unforgiving" is really awesome music, which just meant that I couldn't resist, now that they're finally giving a concert in Switzerland, to go!
The concert will be on the 18th of October at the Volkshaus in Zürich, get tickets while you can, it'll be worth it! ;) See ya there!

Posted by Luca Longinotti on 02 Apr 2011 at 14:06
Categories: Longi Comments




(Page 1 of 1)