Skip to content

FastGeert/go-lfmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lock free threadsafe hashmap written in pure Go

I needed a map implementation that is safe for concurrent access. The current implementation is done via channels, which probably can be improved by using a normal simple mutex.

Installation

go get github.com/fastgeert/go-lfmap

Usage

myMap := NewLFmap()
myMap.Set("key1", "value1")
if tmpValueAsInterface, exists := myMap.Get("key1"); exists {
    if valueAsString, ok := tmpValueAsInterface.(string); ok {
        fmt.Fprintf(os.Stdout, "key1: '%s'", valueAsString)
    }
}
myMap.Exists("key1")
myMap.Remove("key1")

License

Apache 2.0

About

Lock free thread safe hashmap written in pure Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages