The thread-local-storage package

[Tags:benchmark, bsd3, library, test]

Thread-local storage, or TLS, is an important ingredient in many algorithms and data structures.

The GHC compiler does not provide a built-in notion of TLS either at the IO-thread or OS thread level. This package provides a few different implementations of a simple TLS API.

All exported public modules provide exactly the same interface with different implementations. Run the included criterion benchmark suite to ascertain which performs the best on your platform.

Example criterion benchmark data can be found here (from an Intel Ivy-Bridge i7-3770 desktop):

[Skip to Readme]


Versions,,,,, 0.1.1, 0.1.2 (info)
Change log
Dependencies base (>=4.6 && <5.0), containers (>=0.5) [details]
License BSD3
Author Ryan Newton
Category System
Home page
Bug tracker
Source repository head: git clone
Uploaded Fri Jun 23 18:39:34 UTC 2017 by ryanglscott
Distributions LTSHaskell:0.1.1, NixOS:0.1.2, Stackage:0.1.1, Tumbleweed:0.1.1
Downloads 1182 total (34 in the last 30 days)
0 []
Status Docs available [build log]
Last success reported on 2017-06-23 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for thread-local-storage

Readme for thread-local-storage-0.1.2


Hackage Hackage Dependencies Haskell Programming Language BSD3 License Build

See .cabal file for description.

Here are some example benchmark results (on an Ivy Bridge i7-3770), with a typical time of 10.4 nanoseconds to get to a TLS variable given one IO thread per OS thread:

example benchmarks