stm Questions

1

Solved

If an STM transaction fails and retries, does the call to writeTChan get re-executed so that you end up with two writes, or does the STM only actually perform the write if the transaction commits? ...
Gutbucket asked 5/6, 2013 at 7:12

2

Solved

I find TVar's quite easy to work with even though MVar's appear a little simpler, while TVar's a little more featureful. So my question is pretty simple, what condition do I want to go to MVar rat...
Glidewell asked 15/3, 2013 at 18:45

2

Solved

First, some background. I want a queue which I would like to operate in one of two different modes. In the first mode, I want to be able retrieve an element if one exists in the queue but not to bl...
Whang asked 27/1, 2013 at 7:38

1

Solved

Are there any libraries that bring refs, atoms and agents to C code? Are there also structural sharing libraries for C to accompany?
Ina asked 21/1, 2013 at 3:20

1

Solved

This is a sub-problem from my Traveller project. I've put together the rudementary code that will handle input. It works, until I introduce a TChan to the mix. Below is the working code, with an e...
Hackle asked 16/10, 2012 at 16:20

1

I've recently asked a number of questions regarding TVar, and I still have concerns about livelock. So I thought of this structure: Each transaction gets a unique priority (perhaps allocated in ...
Landward asked 11/4, 2012 at 7:44

1

Solved

This is a theoretical question motivated by my desire to understand Clojure's concurrency better. Let's say I'm writing boids. Assume each boid is a separate green thread mutating positions in a v...
Chopin asked 16/8, 2012 at 10:47

3

Solved

I'm considering using a TVar to store some state in a web application (that can be recreated on restart). However, the contention aspects of TVar concern me. It seems that a frequent short running ...
Diphthongize asked 11/4, 2012 at 4:53

1

Solved

Is the "else" part of orElse called when a transaction is retried due to another transaction writing to a TVar it had read, or only when retry is explicitly called?
Edomite asked 11/4, 2012 at 6:35

2

Solved

Can one transaction update two different TVars in an atomic way? i.e. can I compose data structures out of lots of TVars to reduce contention? If so, could you provide an example?
Wandawander asked 11/4, 2012 at 4:29

3

Solved

In a web app I'm trying to generate a unique thread safe id from a limited id pool. The problem I'm facing is that between reading and writing another thread may already have changed the data struc...
Fucoid asked 30/3, 2012 at 9:33

3

Solved

The original question I'm new to STM. One thing I'd like to do in Haskell involves a big piece of data, and lots of lightweight threads reading and writing to small parts of said big piece of data...
Gorget asked 3/3, 2012 at 15:37

3

Solved

I'm looking for some C library that includes STM-style (Software Transactional Memory) hash maps, but I had no luck so far. It would be great if it was based on glib / gobject, but it's not that cr...
Almemar asked 8/11, 2009 at 19:24

1

Solved

I've noticed this idiom in Data.Unique: uniqSource :: TVar Integer uniqSource = unsafePerformIO (newTVarIO 0) {-# NOINLINE uniqSource #-} Is it guaranteed to only run once?
Exurbanite asked 25/12, 2011 at 19:29

1

Solved

When should one prefer Akka TransactionalMap over regular immutable map mixed in with SynchronizedMap and vice versa? (Or am I comparing apples to oranges here?)
Cutworm asked 13/12, 2011 at 21:25

6

Solved

It seems that there has been a recent rising interest in STM (software transactional memory) frameworks and language extensions. Clojure in particular has an excellent implementation which us...
Plunger asked 16/10, 2008 at 18:41

1

Solved

I've been doing some research on STM (software transactional memory) implementations, specifically on algorithms that utilize locks and are not dependent on the presence of a garbage collector in o...
Stonedead asked 8/12, 2011 at 0:34

1

Solved

Is there a good reason why the check function in the Contol.Concurent.STM library has type Bool -> STM a and returns undefined on success rather then having the type Bool -> STM ()? The way i...
Dian asked 3/12, 2011 at 1:58

2

Solved

I have been using Haskell's STM library and I really like the ability to compose transactions and the general "you-can't-get-this-wrong" nature of STM. For good reason, STM does not allow IO actio...
Adulteress asked 19/11, 2011 at 20:56

1

Solved

Is there any way to increase a time interval, on the basis of which the RTS decides that thread has blocked indefinitely in an STM transaction? Here is my code: import Control.Concurrent (ThreadId...
Monomorphic asked 22/10, 2011 at 20:26

2

I am new to Scala and Akka so forgive me if this is a newb question, but I can't find the answer anywhere else... For the record I am using Scala 2.9.0-1 and Akka 1.1.3 and have included my SBT 0...
Goodman asked 31/8, 2011 at 20:9

1

I am new to Scala and Akka and am considering using it to solve a problem. Suppose I have a calculation engine (that searches for a solution). I'd like to parallelize that search both across cpus a...
Tiu asked 2/8, 2011 at 14:44

2

Solved

I've seen the TVar is a simple container, while the TMVar is the same as an MVar, meaning it has a lock etc, but within the STM monad. I am wondering why would that be necessary, as the idea of the...
Spencerspencerian asked 2/8, 2011 at 16:8

1

Solved

Given that the STM holds a history of say 10 values of refs, agents etc, can those values be read ? The reason is, I'm updating a load of agents and I need to keep a history of values. If the STM ...
Jugum asked 27/6, 2011 at 4:26

3

Solved

I'm writing a program where a large number of agents listen for events and react on them. Since Control.Concurrent.Chan.dupChan is deprecated I decided to use TChan's as advertised. The performanc...
Cypsela asked 22/6, 2011 at 12:36

© 2022 - 2024 — McMap. All rights reserved.