Archived
1
0
Fork
You've already forked stm
0
No description
This repository has been archived on 2024年06月28日. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Go 100%
2024年01月20日 00:29:09 +08:00
clock.go feat: initial commit 2024年01月01日 20:00:48 +08:00
errors.go feat: initial commit 2024年01月01日 20:00:48 +08:00
go.mod feat: initial commit 2024年01月01日 20:00:48 +08:00
go.sum feat: initial commit 2024年01月01日 20:00:48 +08:00
LICENSE feat: initial commit 2024年01月01日 20:00:48 +08:00
lock.go feat: initial commit 2024年01月01日 20:00:48 +08:00
README.md feat: initial commit 2024年01月01日 20:00:48 +08:00
tl2.go refactor: remove unnecessary return value 2024年01月20日 00:29:09 +08:00
tl2_test.go refactor: remove unnecessary return value 2024年01月20日 00:29:09 +08:00

Software Transactional Memory

This implementation is based on the paper: Transactional Locking II - D Dice.

cnt:=stm.NewTVar(0)new,err:=stm.Atomically(func(tx*stm.Tx)(any,error){old,err:=cnt.Load(tx)iferr!=nil{returnnil,err}new:=old.(int)+1cnt.Store(tx,new)returnnew,nil})

See tl2_test.go for more examples.