[Haskell-cafe] Can you do everything without shared-memory
concurrency?
Maarten Hazewinkel
maarten.hazewinkel at gmail.com
Wed Sep 10 17:06:50 EDT 2008
On 10 Sep 2008, at 20:28, Ryan Ingram wrote:
> On Wed, Sep 10, 2008 at 2:55 AM, Maarten Hazewinkel
> <maarten.hazewinkel at gmail.com> wrote:
>> [on transaction failures in databases and STM]
>
> This seems to be a bit too much F.U.D. for STM. As long as you avoid
> unsafeIOToSTM (which you really should; that function is far more evil
> than unsafePerformIO), the only failure case for current Haskell STM
> is starvation; some thread will always be making progress and you do
> not have to explicitly handle failure.
>
> This is absolutely guaranteed by the semantics of STM: no effects are
> visible from a retrying transaction--it just runs again from the
> start. You don't have to write "proper error handling" code for
> transactional updates failing.
Thanks for the clarification Ryan.
As a hobbyist I haven't actually used STM, so I was grouping it
with databases as the only transactional system I am directly familiar
with.
I suppose I could have guessed that the Haskell community would come
up with something that's a class better than a normal shared database.
Regards,
Maarten Hazewinkel
More information about the Haskell-Cafe
mailing list