sck / localmemcache

mmap -> lmc_valloc -> hashtable. BAM database

This URL has Read+Write access

localmemcache / README
100644 56 lines (39 sloc) 1.46 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Localmemcache README
=====================
 
A persistent key-value database based on mmap()'ed shared memory.
 
* http://localmemcache.rubyforge.org/
 
WHAT IS IT?
===========
 
Localmemcache is a library for C and ruby that aims to provide
an interface similar to memcached but for accessing local data instead of
remote data. It's based on mmap()'ed shared memory for maximum speed.
Since version 0.3.0 it supports persistence, also making it a fast
alternative to GDBM and Berkeley DB.
 
SUPPORTED SYSTEMS
=================
 
- a >=64bit Unix (32bit is possible but you'll run out of virtual address
  space quickly)
- a file system that offers sparse files
 
Note for OS X: OS X disqualifies as HFS+ doesn't have sparse files and
sem_timedwait() and sem_getvalue() aren't supported as well.
 
Note for FreeBSD: It has been reported that Localmemcache sometimes hangs
there, it is not yet clear what the problem is.
 
EXAMPLE
=======
 
In Ruby:
 
require 'localmemcache'
# 1. the memcached way
# $lm = LocalMemCache.new :namespace => :viewcounters
# 2. the GDBM way
#$lm = LocalMemCache.new :filename => "./viewcounters.lmc"
# 3. Using LocalMemCache::SharedObjectStorage
$lm = LocalMemCache::SharedObjectStorage.new :filename => "./viewcounters.lmc"
$lm[:foo] = 1
$lm[:foo]
$lm.delete(:foo)
 
INSTALLATION
============
 
Ruby binding:
 
# gem install localmemcache
 
If you just want to use the C API, download the .tar.gz from:
 
http://rubyforge.org/frs/?group_id=7925