I have an StmContainers.Map, which I mostly lookup from and insert to.
Occasionally, I have to iterate over the entire map.
As the branches of the HAMT are TVars, I'm guessing the listT operation is subject to a retry, if anything changes in the map while iterating?
This probably means the iteration operation will be starved, in my current setup.
Do you think it's possible to add a non-transactional iteration in IO to StmContainers.Map, or do you think I should be using a TVar (Hashmap k v) instead?
Hello @nikita-volkov,
I have an
StmContainers.Map
, which I mostlylookup
from andinsert
to.Occasionally, I have to iterate over the entire map.
As the branches of the
HAMT
areTVars
, I'm guessing thelistT
operation is subject to aretry
, if anything changes in the map while iterating?This probably means the iteration operation will be starved, in my current setup.
Do you think it's possible to add a non-transactional iteration in
IO
toStmContainers.Map
, or do you think I should be using aTVar (Hashmap k v)
instead?