Skip to content

jkbrsn/threadsafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

threadsafe Go Documentation MIT License

The threadsafe package provides thread-safe operations for various data structures common in concurrent Go applications.

The interfaces provided by the package are generic, and attempt to be quite exhaustive feature wise. If a more minimal interface would be better aligned for your application, create it as needed.

All interface implementations in this package are thread-safe and can be used concurrently.

Key Features

  • Generic, thread-safe maps, sets, queues, heaps, and priority queues.
  • Iterator-first APIs for idiomatic range loops.
    • Note: due to the snapshotting used to keep the iterators thread-safe, some iterators may be less performant than a standard Range iteration.
  • Multiple concurrency strategies (mutex, RWMutex, sync.Map) so you can pick the right trade-offs.

Tests and benchmarks

The package provides a Makefile with targets for running tests and benchmarks:

make test
make bench

Contribute

For contributions, please open a GitHub issue with your questions and suggestions. Before submitting an issue, have a look at the existing TODO list to see if your idea is already in the works.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published