Skip to Main Content
Parallel and Concurrent Programming in Haskell
book

Parallel and Concurrent Programming in Haskell

by Simon Marlow
July 2013
Intermediate to advanced content levelIntermediate to advanced
322 pages
8h 43m
English
O'Reilly Media, Inc.
Content preview from Parallel and Concurrent Programming in Haskell

Chapter 14. Distributed Programming

Up until now, we have been considering programs that run on a single machine, while possibly making use of multiple processors to exploit parallelism. But there is a far more plentiful source of parallelism: running a program on multiple machines simultaneously. We call this distributed programming, and Haskell supports it through a framework called distributed-process.[50]

Aside from the obvious advantages of multimachine parallelism, there are other reasons to write distributed programs. For example:

  • A distributed server can make more efficient use of network resources by moving the servers closer to the clients. We will see an example of this in A Distributed Chat Server.
  • A distributed program can exploit a heterogeneous environment, where certain resources are available only to certain machines. An example of this might be a cluster of machines with local disks, where a large data structure is spread across the disks and we wish to run our computation on the machine that has the appropriate part of the data structure on its local disk.

So what should distributed programming look like from the programmer’s perspective? Should it look like Concurrent Haskell, with forkIO, MVar, and STM? In fact, there are some good reasons to treat distributed computation very differently from computation on a shared-memory multicore:

  • There is a realistic possibility of partial hardware failure: that is, some of the machines involved in a computation may go ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Haskell High Performance Programming

Haskell High Performance Programming

Samuli Thomasson
Haskell Cookbook

Haskell Cookbook

Yogesh Sajanikar
Haskell in Depth

Haskell in Depth

Vitaly Bragilevsky

Publisher Resources

ISBN: 9781449335939Supplemental ContentErrata Page