transactional-memory

What will it take for Transactional Memory to be viable?

六月ゝ 毕业季﹏ 提交于 2019-12-06 05:22:51
问题 I've been doing some work on transactional memory and its viability for systems programming (databases, operating systems, servers, etc.). My own experience employing transactions, together with having seen how few communities use transactions in real code, has raised a question: What would convince you, a developer writing production code, to employ transactional memory in your work? Would it be general adoption? High speed? Improved reliability? By how much? For those that haven't seen them

What will it take for Transactional Memory to be viable?

痞子三分冷 提交于 2019-12-04 11:00:49
I've been doing some work on transactional memory and its viability for systems programming (databases, operating systems, servers, etc.). My own experience employing transactions, together with having seen how few communities use transactions in real code, has raised a question: What would convince you, a developer writing production code, to employ transactional memory in your work? Would it be general adoption? High speed? Improved reliability? By how much? For those that haven't seen them, memory transactions act like database transactions: operations proceed (apparently) in parallel, and

Software Transactional Memory - Composability Example

◇◆丶佛笑我妖孽 提交于 2019-11-29 06:15:47
问题 One of the major advantages of software transactional memory that always gets mentioned is composability and modularity. Different fragments can be combined to produce larger components. In lock-based programs, this is often not the case. I am looking for a simple example illustrating this with actual code. I'd prefer an example in Clojure, but Haskell is fine too. Bonus points if the example also exhibits some lock-based code which can't be composed easily. 回答1: An example where locks don't

STM monad problem

谁说我不能喝 提交于 2019-11-29 06:00:47
This is just a hypothetical scenario to illustrate my question. Suppose that there are two threads and one TVar shared between them. In one thread there is an atomically block that reads the TVar and takes 10s to complete. In another thread is an atomically block that modifies the TVar every second. Will the first atomically block ever complete? Surely it will just keep going back to the beginning, because the log is perpetually in an inconsistent state? As others have said: in theory there is no guarantee of progress. In practice there is also no guarantee of progress: import Control.Monad --

STM monad problem

99封情书 提交于 2019-11-27 23:46:34
问题 This is just a hypothetical scenario to illustrate my question. Suppose that there are two threads and one TVar shared between them. In one thread there is an atomically block that reads the TVar and takes 10s to complete. In another thread is an atomically block that modifies the TVar every second. Will the first atomically block ever complete? Surely it will just keep going back to the beginning, because the log is perpetually in an inconsistent state? 回答1: As others have said: in theory