Changes between Initial Version and Version 2 of Ticket #935


Ignore:
Timestamp:
Oct 12, 2006 11:06:59 AM (9 years ago)
Author:
simonmar
Comment:

Fixed; thanks.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #935

    • Property Status changed from new to closed
    • Property Resolution changed from to fixed
    • Property Component changed from GHCi to Documentation
  • Ticket #935 – Description

    initial v2  
    55
    66<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    7 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>7.15. Parallel Haskell</title><link rel="stylesheet" href="lang-parallel_files/fptools.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="http://haskell.org/ghc/docs/6.6/html/users_guide/index.html" title="The Glorious Glasgow Haskell Compilation System User's Guide, Version 6.6"><link rel="up" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ghc-language-features.html" title="Chapter 7. GHC Language Features"><link rel="prev" href="http://haskell.org/ghc/docs/6.6/html/users_guide/monomorphism.html" title="7.14. Control over monomorphism"><link rel="next" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ffi.html" title="Chapter 8. 
     7<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>7.15. Parallel Haskell</title><link rel="stylesheet" href="lang-parallel_files/fptools.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="http://haskell.org/ghc/docs/6.6/html/users_guide/index.html" title="The Glorious Glasgow Haskell Compilation System User's Guide, Version 6.6"><link rel="up" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ghc-language-features.html" title="Chapter 7. GHC Language Features"><link rel="prev" href="http://haskell.org/ghc/docs/6.6/html/users_guide/monomorphism.html" title="7.14. Control over monomorphism"><link rel="next" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ffi.html" title="Chapter 8.
    88Foreign function interface (FFI)
    99 "></head>
    10 <body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084"><div class="navheader"><table summary="Navigation header" width="100%"><tbody><tr><th colspan="3" align="center">7.15. Parallel Haskell</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="http://haskell.org/ghc/docs/6.6/html/users_guide/monomorphism.html">Prev</a> </td><th align="center" width="60%">Chapter 7. GHC Language Features</th><td align="right" width="20%"> <a accesskey="n" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ffi.html">Next</a></td></tr></tbody></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both;"><a name="lang-parallel"></a>7.15. Parallel Haskell</h2></div></div></div><a class="indexterm" name="id3181622"></a><p>There are two implementations of Parallel Haskell: SMP paralellism
     10<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084"><div class="navheader"><table summary="Navigation header" width="100%"><tbody><tr><th colspan="3" align="center">7.15. Parallel Haskell</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="http://haskell.org/ghc/docs/6.6/html/users_guide/monomorphism.html">Prev</a> </td><th align="center" width="60%">Chapter 7. GHC Language Features</th><td align="right" width="20%"> <a accesskey="n" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ffi.html">Next</a></td></tr></tbody></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both;"><a name="lang-parallel"></a>7.15. Parallel Haskell</h2></div></div></div><a class="indexterm" name="id3181622"></a><p>There are two implementations of Parallel Haskell: SMP paralellism
    1111    <a class="indexterm" name="id3181636"></a>
    12     which is built-in to GHC (see <a href="http://haskell.org/ghc/docs/6.6/html/users_guide/sec-using-smp.html" title="4.12. Using SMP parallelism">Section 4.12, &#8220;Using SMP parallelism&#8221;</a>) and
     12    which is built-in to GHC (see <a href="http://haskell.org/ghc/docs/6.6/html/users_guide/sec-using-smp.html" title="4.12. Using SMP parallelism">Section 4.12, &#8220;Using SMP parallelism&#8221;</a>) and
    1313    supports running Parallel Haskell programs on a single multiprocessor
    1414    machine, and
     
    2020      GPH Page</a>).</p><p>Ordinary single-threaded Haskell programs will not benefit from
    2121    enabling SMP parallelism alone.  You must expose parallelism to the
    22     compiler in one of the following two ways.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id3181681"></a>7.15.1. Running Concurrent Haskell programs in parallel</h3></div></div></div><p>The first possibility is to use concurrent threads to structure your
     22    compiler in one of the following two ways.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id3181681"></a>7.15.1. Running Concurrent Haskell programs in parallel</h3></div></div></div><p>The first possibility is to use concurrent threads to structure your
    2323      program, and make sure
    2424      that you spread computation amongst the threads.  The runtime will
    2525      schedule the running Haskell threads among the available OS
    2626      threads, running as many in parallel as you specified with the
    27       <code class="option">-N</code> RTS option.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id3181704"></a>7.15.2. Annotating pure code for parallelism</h3></div></div></div><p>The simplest mechanism for extracting parallelism from pure code is
     27      <code class="option">-N</code> RTS option.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id3181704"></a>7.15.2. Annotating pure code for parallelism</h3></div></div></div><p>The simplest mechanism for extracting parallelism from pure code is
    2828      to use the <code class="literal">par</code> combinator, which is closely related to (and often used
    2929      with) <code class="literal">seq</code>.  Both of these are available from <a href="http://haskell.org/ghc/docs/6.6/html/libraries/base/Control-Parallel.html" target="_top"><code class="literal">Control.Parallel</code></a>:</p><pre class="programlisting">infixr 0 `par`
     
    6666      This module builds functionality around <code class="literal">par</code>,
    6767      expressing more elaborate patterns of parallel computation, such as
    68       parallel <code class="literal">map</code>.</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tbody><tr><td align="left" width="40%"><a accesskey="p" href="http://haskell.org/ghc/docs/6.6/html/users_guide/monomorphism.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ghc-language-features.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ffi.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">7.14. Control over monomorphism </td><td align="center" width="20%"><a accesskey="h" href="http://haskell.org/ghc/docs/6.6/html/users_guide/index.html">Home</a></td><td align="right" valign="top" width="40%"> Chapter 8. 
     68      parallel <code class="literal">map</code>.</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tbody><tr><td align="left" width="40%"><a accesskey="p" href="http://haskell.org/ghc/docs/6.6/html/users_guide/monomorphism.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ghc-language-features.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="http://haskell.org/ghc/docs/6.6/html/users_guide/ffi.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">7.14. Control over monomorphism </td><td align="center" width="20%"><a accesskey="h" href="http://haskell.org/ghc/docs/6.6/html/users_guide/index.html">Home</a></td><td align="right" valign="top" width="40%"> Chapter 8.
    6969Foreign function interface (FFI)
    7070 </td></tr></tbody></table></div></body></html>