compiling concurrent haskell with ghc

Dennis Sidharta daniel_jian@yahoo.com
Mon, 28 Jul 2003 20:06:37 -0700 (PDT)


--0-1917843039-1059447997=:22952
Content-Type: text/plain; charset=us-ascii

Hi Sven,
 
Thanks for the pointer! I will try to play around with MVar.
 
 
Sincerely,
 
Dennis

Sven Panne <Sven.Panne@informatik.uni-muenchen.de> wrote:
Dennis Sidharta wrote:
> [ problems with concurrent Haskell ]

I can see two problems in your code:

* forkIO creates "daemon threads", so the program terminates immediately.

* Chan is an unbounded channel, so you won't get a "ping pong", which
is probably what you expected. MVar is your friend here.

See http://haskell.org/ghc/docs/latest/html/base/Control.Concurrent.html

Cheers,
S.




---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
--0-1917843039-1059447997=:22952
Content-Type: text/html; charset=us-ascii

<DIV>Hi Sven,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for the pointer! I will try to play around with MVar.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Sincerely,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Dennis<BR><BR><B><I>Sven Panne &lt;Sven.Panne@informatik.uni-muenchen.de&gt;</I></B> wrote:</DIV>
<DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid; WIDTH: 100%">Dennis Sidharta wrote:<BR>&gt; [ problems with concurrent Haskell ]<BR><BR>I can see two problems in your code:<BR><BR>* forkIO creates "daemon threads", so the program terminates immediately.<BR><BR>* Chan is an unbounded channel, so you won't get a "ping pong", which<BR>is probably what you expected. MVar is your friend here.<BR><BR>See http://haskell.org/ghc/docs/latest/html/base/Control.Concurrent.html<BR><BR>Cheers,<BR>S.<BR><BR></BLOCKQUOTE></DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/evt=10469/*http://sitebuilder.yahoo.com">Yahoo! SiteBuilder</a> - Free, easy-to-use web site design software
--0-1917843039-1059447997=:22952--