From c280e21fb34546e60ace8207f3dc2d4a785fec92 Mon Sep 17 00:00:00 2001 From: lukechampine Date: Thu, 31 Mar 2016 02:08:30 -0400 Subject: document weak equality --- stm.go | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3