Last Modified
2013-07-01 18:04:14 +0000
Requires
  • raindrops_ext
Trac URL
http://bogomips.org/raindrops.git/tree/lib/raindrops.rb

Description

Each Raindrops object is a container that holds several counters. It is internally a page-aligned, shared memory area that allows atomic increments, decrements, assignments and reads without any locking.

rd = Raindrops.new 4
rd.incr(0, 1)   -> 1
rd.to_ary       -> [ 1, 0, 0, 0 ]

Unlike many classes in this package, the core Raindrops class is intended to be portable to all reasonably modern *nix systems supporting mmap(). Please let us know if you have portability issues, patches or pull requests at raindrops@librelist.org