* STM_UNIPROC assumes that the caller serialises invocations on the STM * interface. In the Haskell RTS this means it is suitable only for * non-THREADED_RTS builds. * * STM_CG_LOCK uses coarse-grained locking -- a single 'stm lock' is acquired * during an invocation on the STM interface. Note that this does not mean that * transactions are simply serialized -- the lock is only held *within* the * implementation of stmCommitTransaction, stmWait etc. * * STM_FG_LOCKS uses fine-grained locking -- locking is done on a per-TVar basis * and, when committing a transaction, no locks are acquired for TVars that have * been read but not updated.
...
* lock_stm & unlock_stm are straightforward : they acquire a simple spin-lock * using STM_CG_LOCK, and otherwise they are no-ops.
no subject
Date: 2015-11-06 04:05 pm (UTC)https://github.com/ghc/ghc/blob/master/rts/STM.c
* STM_UNIPROC assumes that the caller serialises invocations on the STM
* interface. In the Haskell RTS this means it is suitable only for
* non-THREADED_RTS builds.
*
* STM_CG_LOCK uses coarse-grained locking -- a single 'stm lock' is acquired
* during an invocation on the STM interface. Note that this does not mean that
* transactions are simply serialized -- the lock is only held *within* the
* implementation of stmCommitTransaction, stmWait etc.
*
* STM_FG_LOCKS uses fine-grained locking -- locking is done on a per-TVar basis
* and, when committing a transaction, no locks are acquired for TVars that have
* been read but not updated.
...
* lock_stm & unlock_stm are straightforward : they acquire a simple spin-lock
* using STM_CG_LOCK, and otherwise they are no-ops.
Забавно они сделали то, что сделали.
Надо будет попробовать по-моему сделать.