Tim Docker wrote:
Is it possible to use the forkIO primitive to cause pure computations
to be evaluated in parallel threads?
Somebody correct me here - I was under the impression that you only ever
need forkIO if you're doing something strange with FFI, and usually you
just want fork?
Am Dienstag, 6. November 2007 schrieb Andrew Coppin:
Somebody correct me here - I was under the impression that you only ever
need forkIO if you're doing something strange with FFI, and usually you
just want fork?
You're probably thinking of forkOS vs. forkIO.
AFAIK there is no fork in
andrewcoppin:
Tim Docker wrote:
Is it possible to use the forkIO primitive to cause pure computations
to be evaluated in parallel threads?
Somebody correct me here - I was under the impression that you only ever
need forkIO if you're doing something strange with FFI, and usually you
Don Stewart wrote:
andrewcoppin:
Somebody correct me here - I was under the impression that you only ever
need forkIO if you're doing something strange with FFI, and usually you
just want fork?
That's incorrect. forkIO is *the* basic threading primitive for fast,
light Haskell
On Mon, 2007-11-05 at 20:12 +, Andrew Coppin wrote:
Hi folks.
Take a look at this:
render :: IOArray Point Colour - (Point - Colour) - IO ()
render framebuffer fn = mapM_ (\p - writeArray framebuffer p (fn p))
all_points
How do I alter this to compute fn in multiple threads
Jonathan Cast wrote:
On Mon, 2007-11-05 at 20:12 +, Andrew Coppin wrote:
Hi folks.
Take a look at this:
render :: IOArray Point Colour - (Point - Colour) - IO ()
render framebuffer fn = mapM_ (\p - writeArray framebuffer p (fn p))
all_points
How do I alter this to compute fn in
Hello Andrew,
Monday, November 5, 2007, 11:12:33 PM, you wrote:
How do I alter this to compute fn in multiple threads in parallel? (As
jobs :: [IO()]
let fork job = do mvar - newEmptyMVar
forkIO$ do job; putMVar mvar ()
return mvar
tasks - mapM fork jobs
-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bulat Ziganshin
Sent: Tuesday, 6 November 2007 10:59 AM
To: Andrew Coppin
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] Go parallel
Hello Andrew,
Monday, November 5, 2007, 11:12:33 PM, you wrote:
How do I alter
timd:
Is it possible to use the forkIO primitive to cause pure computations
to be evaluated in parallel threads?
It seems to me that laziness would always prevent any evaluation until
the result was used in a consuming thread (and hence would occur
serially, in that thread).
Try `par` and
November 2007 11:16 AM
To: Tim Docker
Cc: haskell-cafe@haskell.org; Bulat Ziganshin
Subject: Re: [Haskell-cafe] Go parallel
timd:
Is it possible to use the forkIO primitive to cause pure computations
to be evaluated in parallel threads?
It seems to me that laziness would always prevent any
On Nov 5, 2007, at 15:46 , Andrew Coppin wrote:
You can spark a thread for each computation of fn, like such:
writeArray framebuffer p `parApp` fn p
where
parApp f x = x `par` f x
Hmm, that may be a little *too* fine-grained. (But then, just
because I spark 175,862 threads doesn't mean
11 matches
Mail list logo