[Haskell-cafe] Compiling ghc for using STM

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Jul 17 11:48:32 EDT 2006


Hello Asfand,

Monday, July 17, 2006, 7:31:23 PM, you wrote:

> I finally got my spiffy dual-core processor (an Opteron 165 no-less)
> and want to learn STM, since I think it and haskell are the future of
> concurrent programming.

> How do I compile Haskell to be able learn STM on it, using "proper"
> threading?  I know there's a parallel haskell flag, but I read
> somewhere about it running on top of some special server that lets it
> work in parallel threads or something.

you should compile with "-threaded" flag which allows to preempt
threads created in your program with forkIO/forkOS

if you want to really use 2 processors, you should use ghc 6.5, which
is still in beta stage. ghc 6.4 executes all the Haskell code on one
processor (to be exact, at each moment there is only one program
thread executing Haskell code)

look at http://www.cse.unsw.edu.au/~chak/haskell/ghc/comm/rts-libs/multi-thread.html
which describes 6.4 situation

http://research.microsoft.com/Users/simonpj/papers/marktoberdorf/marktoberdorf.ps.gz
contains Concurrency chapter what says more about concurrency in GHC

You can find more information about concurrency and STM at the
http://haskell.org/haskellwiki/GHC/Concurrency page


ps: are you one of Iranian hackers cheating A-bomb? ;)

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list