stone-wind / seqlocks

An implementation of sequence locks (seqlocks) for lock-free reads in C using atomics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seqlocks

An implementation of sequence locks (seqlocks) for lock-free reads in C using atomics

  • The header file contains the implementation.
  • The source file contains usage examples of reading and writing

Note

The implementation assumes x86 architecture (i.e. the TSO memory model) where the memory ordering read --> acquire is enforced (and thus only requires a compiler barrier). For more information for a portable implementation, I recommend Boehms's paper

About

An implementation of sequence locks (seqlocks) for lock-free reads in C using atomics

License:MIT License


Languages

Language:C 100.0%