Hi Luca,
Just in case you weren't aware of it, your example didn't actually
contain any STM (beyond the import), just regular Haskell IO-based
concurrency.
But the answer to your question is that there's no synchronization on
writing to a file descriptor, so both threads are "simultaneously"
writ
Thanks Dan.
I understand, your explanation is clear.
I just need to study more Haskell. Im' just a beginner but very
enthusiastic learning this "think-different" language (I'm a 12-year
experienced C++ programmer).
Thanks again.
Luca.
On Oct 2, 2009, at 6:28 PM, Daniel Peebles wrote:
H
On Fri, Oct 02, 2009 at 06:16:49PM +0200, Luca Ciciriello wrote:
>
> Compiling this module with:
>
> ghc --make Main.hs -o Main
>
> and launcing ./Main the result is just:
>
> Terminal> world
Also, the reason you only get "world" here is likely because the main
thread prints "world" and exits befo
Brent Yorgey schrieb:
> On Fri, Oct 02, 2009 at 06:16:49PM +0200, Luca Ciciriello wrote:
>> Compiling this module with:
>>
>> ghc --make Main.hs -o Main
>>
>> and launcing ./Main the result is just:
>>
>> Terminal> world
>
> Also, the reason you only get "world" here is likely because the main
> t
From: cars...@codimi.de
> Date: Mon, 12 Oct 2009 13:34:36 +0200
> Subject: Re: STM experiment
>
> Brent Yorgey schrieb:
> > On Fri, Oct 02, 2009 at 06:16:49PM +0200, Luca Ciciriello wrote:
> >> Compiling this module with:
> >>
> >> ghc --make Main.hs
Luca Ciciriello schrieb:
> Thanks Carsten, I've compiled your example and all works as expected.
>
> Just a note.
> If I load the module in GHCi (intead of compiling it) and launch main
> function the result is quite strange. I obtain:
>
> He lwloorld
So we actually observe the concurrency her