[Haskell-cafe] forkIO on multicore

Jake McArthur jake at pikewerks.com
Fri Dec 19 11:42:30 EST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Keir wrote:
> fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

This is a CAF (Constant Applicative Form). Since it is actually a
constant it is never garbage collected, and is always shared, so each
thread is only calculating it once. You have essentially created a
lookup table.

- - Jake
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklLzvIACgkQye5hVyvIUKkaBACfTJfoWokgzmkyN8wm8zIeGc89
UcwAoK2VR8c0zCs0P6XTmAaJcN8oaDYc
=9Yu/
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list