This is an implementation of TL2 (Dice, Shalev and Shavit) in STM Haskell. Code adapted from implementation of Du Bois.
Included in the src
directory are sample concurrent algorithms and data structures designed to use STM, adapted from:
Performance benchmark in this project is performed with criterion
on a producer-consumer problem with 100,000 shared elements on a binary heap, with 16 producers and 16 consumers. Performance report of this lock-based TL2 algorithm is found in lock-based result.html
. Performance report of the default lock-free STM is found in lock-free result.html
.
Make sure you have stack
installed. Clone this repository. Then run stack build; stack execute stm-exe
. To generate the report again, append the flag -- --output report_filename.html
at the end of the command.