[Haskell-cafe] synchronous channels in STM

Ryan Ingram ryani.spam at gmail.com
Thu Oct 9 04:15:57 EDT 2008


I don't think what you want is possible if both sides are in STM.
Other authors have posted solutions where one side or the other of the
transaction is in I/O, but wholly inside STM it's not possible.

The problem is that in order for synchronization to happen, you need
both sides to be able to communicate with each other.  But the whole
point of STM is that each transaction is atomically isolated from
other transactions running concurrently; you can find out what
transactions that committed before you have done, but there is no way
for you to interact with another transaction in-flight.

  -- ryan

On Wed, Oct 8, 2008 at 11:10 PM, roger peppe <rogpeppe at gmail.com> wrote:
> I was wondering if it was possible to implement synchronous channels
> within STM. In particular, I'd like to have CSP-like send and recv primitives
> on a channel that each block until the other side arrives to complete
> the transaction.
>
> I think I've convinced myself that it's not possible, but
> anyone care to differ?
>
>  cheers,
>    rog.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list