cuckoo

package module
v0.0.0-...-050ca0b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2013 License: Apache-2.0 Imports: 4 Imported by: 0

README

go-cuckoo

A high-performance, memory-efficient concurrent hash table

Or at least, it will be. Currently being developed out of this repository. Don't use it. It probably doesn't do anything you want quite yet.

Documentation

Overview

Package cuckoo provides an implementation of a high-performance, memory efficient hash table that supports fast and safe concurrent access by multiple threads. The default version of the hash table uses string keys and interface{} values. For faster performance and fewer annoying typecasting issues, copy this code and change the valuetype appropriately.

Index

Constants

View Source
const (
	SLOTS_PER_BUCKET    = 4  // This is kinda hardcoded all over the place
	DEFAULT_START_POWER = 16 // 2^16 keys to start with.
	N_LOCKS             = 2048
	MAX_REACH           = 500 // number of buckets to examine before full
	MAX_PATH_DEPTH      = 5   // must be ceil(log4(MAX_REACH))
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table struct {
	// contains filtered or unexported fields
}

func NewTable

func NewTable() *Table

func NewTablePowerOfTwo

func NewTablePowerOfTwo(twopower uint) *Table

func (*Table) Delete

func (t *Table) Delete(k keytype) error

func (*Table) Get

func (t *Table) Get(k keytype) (v valuetype, found bool)

func (*Table) Put

func (t *Table) Put(k keytype, v valuetype) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL