aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukechampine <luke.champine@gmail.com>2016-03-31 02:08:30 -0400
committerlukechampine <luke.champine@gmail.com>2016-03-31 02:08:30 -0400
commitc280e21fb34546e60ace8207f3dc2d4a785fec92 (patch)
treed837eea075c1be0bfeaea5cc6f0ee7d7301175fa
parentrearrange + add comments (diff)
downloadstm-c280e21fb34546e60ace8207f3dc2d4a785fec92.tar.gz
stm-c280e21fb34546e60ace8207f3dc2d4a785fec92.tar.xz
document weak equality
-rw-r--r--stm.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/stm.go b/stm.go
index 4db7c17..cc1680f 100644
--- a/stm.go
+++ b/stm.go
@@ -69,6 +69,11 @@ behavior. One common way to get around this is to build up a list of impure
operations inside the transaction, and then perform them after the transaction
completes.
+Another caveat: stm uses simple pointer equality to determine whether Vars
+have changed during a transaction. For types containing mutable pointers, this
+may be insufficient; immutable values should be used instead. Support for
+proper versioning is planned.
+
The stm API tries to mimic that of Haskell's Control.Concurrent.STM, but this
is not entirely possible due to Go's type system; we are forced to use
interface{} and type assertions. Furthermore, Haskell can enforce at compile