--
---
You received this message because you are subscribed to the Google Groups "Scala STM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-stm-expert-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Kevin,Both approaches will have the right behavior, but TMap will give you more concurrency. The STM checks whether transactions can safely run in parallel at the granularity of a Ref. Ref[Map] has only a single ref, so if any thread writes to the map then all of the other transactions will have to wait to read. TMap a hash trie built of Ref-s, so transactions can simultaneously write different leaves without colliding.- Nathan
On Mon, Jun 10, 2013 at 8:14 AM, Kevin Esler <kevin...@gmail.com> wrote:
I'm new to STM so go easy on the newbie. I have an Akka app in which various actors need to share a cache so STM looks like the thing to use.The cache has the semantics of a Scala Map. I see I could use TMap, but it seems like I could also just store the cache as an immutable Map inside a Ref.What are the pros and cons of these two alternatives?
--
---
You received this message because you are subscribed to the Google Groups "Scala STM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-stm-expert-group+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.