Parallel and concurrent programming in Haskell: [techniques for multicore and multithreaded programming]
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Beijing [u.a.]
O'Reilly
2013
|
Ausgabe: | 1. ed. |
Schlagworte: | |
Online-Zugang: | Inhaltstext Inhaltsverzeichnis |
Beschreibung: | XIV, 304 S. Ill., graph. Darst. |
ISBN: | 9781449335946 1449335942 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV041251460 | ||
003 | DE-604 | ||
005 | 20131125 | ||
007 | t | ||
008 | 130902s2013 ad|| |||| 00||| eng d | ||
015 | |a 13,N28 |2 dnb | ||
016 | 7 | |a 1036703932 |2 DE-101 | |
020 | |a 9781449335946 |c : EUR 31.99 (DE) (freier Pr.), EUR 32.90 (AT) (freier Pr.) |9 978-1-449-33594-6 | ||
020 | |a 1449335942 |9 1-449-33594-2 | ||
024 | 3 | |a 9781449335946 | |
035 | |a (OCoLC)862800173 | ||
035 | |a (DE-599)DNB1036703932 | ||
040 | |a DE-604 |b ger |e rakddb | ||
041 | 0 | |a eng | |
049 | |a DE-29T |a DE-11 |a DE-91G |a DE-706 | ||
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a 004 |2 sdnb | ||
084 | |a DAT 362f |2 stub | ||
100 | 1 | |a Marlow, Simon |e Verfasser |0 (DE-588)104224538X |4 aut | |
245 | 1 | 0 | |a Parallel and concurrent programming in Haskell |b [techniques for multicore and multithreaded programming] |c Simon Marlow |
250 | |a 1. ed. | ||
264 | 1 | |a Beijing [u.a.] |b O'Reilly |c 2013 | |
300 | |a XIV, 304 S. |b Ill., graph. Darst. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 0 | 7 | |a HASKELL |0 (DE-588)4318275-6 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Parallelverarbeitung |0 (DE-588)4075860-6 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Nebenläufigkeit |0 (DE-588)4115352-2 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a HASKELL |0 (DE-588)4318275-6 |D s |
689 | 0 | 1 | |a Parallelverarbeitung |0 (DE-588)4075860-6 |D s |
689 | 0 | 2 | |a Nebenläufigkeit |0 (DE-588)4115352-2 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m X:MVB |q text/html |u http://deposit.dnb.de/cgi-bin/dokserv?id=4376825&prov=M&dok_var=1&dok_ext=htm |3 Inhaltstext |
856 | 4 | 2 | |m HBZ Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026225492&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
943 | 1 | |a oai:aleph.bib-bvb.de:BVB01-026225492 |
Datensatz im Suchindex
_version_ | 1806325728041500672 |
---|---|
adam_text |
Titel: Parallel and concurrent programming in Haskell
Autor: Marlow, Simon
Jahr: 2013
Table of Contents
Preface. ix
1. Introduction. 1
Terminology: Parallelism and Concurrency 2
Tools and Resources 3
Sample Code 4
Part I. Parallel Haskell
2. Basic Parallelism: The Eval Monad.9
Lazy Evaluation and Weak Head Normal Form 9
The Eval Monad, rpar, and rseq 15
Example: Parallelizing a Sudoku Solver 19
Deepseq 29
3. Evaluation Strategies.31
Parameterized Strategies 32
A Strategy for Evaluating a List in Parallel 34
Example: The K-Means Problem 35
Parallelizing K-Means 40
Performance and Analysis 42
Visualizing Spark Activity 46
Granularity 47
GC'd Sparks and Speculative Parallelism 48
Parallelizing Lazy Streams with parBuffer 51
Chunking Strategies 54
The Identity Property 55
4. Dataflow Parallelism: The Par Monad.57
iii
Example: Shortest Paths in a Graph 61
Pipeline Parallelism 65
Rate-Limiting the Producer 68
Limitations of Pipeline Parallelism 69
Example: A Conference Timetable 70
Adding Parallelism 74
Example: A Parallel Type Inferencer 77
Using Different Schedulers 82
The Par Monad Compared to Strategies 82
5. Data Parallel Programming with Repa.85
Arrays, Shapes, and Indices 86
Operations on Arrays 88
Example: Computing Shortest Paths 90
Parallelizing the Program 93
Folding and Shape-Polymorphism 95
Example: Image Rotation 97
Summary 101
6. GPU Programming with Accelerate.103
Overview 104
Arrays and Indices 105
Running a Simple Accelerate Computation 106
Scalar Arrays 108
Indexing Arrays 108
Creating Arrays Inside Acc 109
Zipping Two Arrays 111
Constants 111
Example: Shortest Paths 112
Running on the GPU 115
Debugging the CUDA Backend 116
Example: A Mandelbrot Set Generator 116
Part II. Concurrent Haskell
7. Basic Concurrency: Threads and MVars.125
A Simple Example: Reminders 126
Communication: MVars 128
MVar as a Simple Channel: A Logging Service 130
MVar as a Container for Shared State 133
MVar as a Building Block: Unbounded Channels 135
iv | Table of Contents
Fairness
140
8. Overlapping Input/Output.143
Exceptions in Haskell 146
Error Handling with Async 151
Merging 152
9. Cancellation and Timeouts.155
Asynchronous Exceptions 156
Masking Asynchronous Exceptions 158
The bracket Operation 162
Asynchronous Exception Safety for Channels 162
Timeouts 164
Catching Asynchronous Exceptions 166
mask and forklO 168
Asynchronous Exceptions: Discussion 170
10. Software Transactional Memory. 173
Running Example: Managing Windows 173
Blocking 177
Blocking Until Something Changes 179
Merging with STM 181
Async Revisited 182
Implementing Channels with STM 184
More Operations Are Possible 185
Composition of Blocking Operations 185
Asynchronous Exception Safety 186
An Alternative Channel Implementation 187
Bounded Channels 189
What Can We Not Do with STM? 191
Performance 193
Summary 195
11. Higher-Level Concurrency Abstractions. 197
Avoiding Thread Leakage 197
Symmetric Concurrency Combinators 199
Timeouts Using race 201
Adding a Functor Instance 202
Summary: The Async API 203
12. Concurrent Network Servers. 205
A Trivial Server 205
Table of Contents | v
Extending the Simple Server with State 209
Design One: One Giant Lock 209
Design Two: One Chan Per Server Thread 210
Design Three: Use a Broadcast Chan 211
Design Four: Use STM 212
The Implementation 213
A Chat Server 216
Architecture 217
Client Data 217
Server Data 218
The Server 219
Setting Up a New Client 219
Running the Client 222
Recap 223
13. Parallel Programming Using Threads.225
How to Achieve Parallelism with Concurrency 225
Example: Searching for Files 226
Sequential Version 226
Parallel Version 228
Performance and Scaling 230
Limiting the Number of Threads with a Semaphore 231
The ParlO monad 237
14. Distributed Programming. 241
The Distributed-Process Family of Packages 242
Distributed Concurrency or Parallelism? 244
A First Example: Pings 244
Processes and the Process Monad 245
Defining a Message Type 245
The Ping Server Process 246
The Master Process 248
The main Function 249
Summing Up the Ping Example 250
Multi-Node Ping 251
Running with Multiple Nodes on One Machine 252
Running on Multiple Machines 253
Typed Channels 254
Merging Channels 257
Handling Failure 258
The Philosophy of Distributed Failure 261
A Distributed Chat Server 262
vi | Table of Contents
Data Types 263
Sending Messages 265
Broadcasting 265
Distribution 266
Testing the Server 269
Failure and Adding/Removing Nodes 269
Exercise: A Distributed Key-Value Store 271
15. Debugging, Tuning, and Interfacing with Foreign Code. 275
Debugging Concurrent Programs 275
Inspecting the Status of a Thread 275
Event Logging and ThreadScope 276
Detecting Deadlock 278
Tuning Concurrent (and Parallel) Programs 280
Thread Creation and MVar Operations 281
Shared Concurrent Data Structures 283
RTS Options to Tweak 284
Concurrency and the Foreign Function Interface 286
Threads and Foreign Out-Calls 286
Asynchronous Exceptions and Foreign Calls 288
Threads and Foreign In-Calls 289
Index. 291
Table of Contents | vii |
any_adam_object | 1 |
author | Marlow, Simon |
author_GND | (DE-588)104224538X |
author_facet | Marlow, Simon |
author_role | aut |
author_sort | Marlow, Simon |
author_variant | s m sm |
building | Verbundindex |
bvnumber | BV041251460 |
classification_rvk | ST 250 |
classification_tum | DAT 362f |
ctrlnum | (OCoLC)862800173 (DE-599)DNB1036703932 |
discipline | Informatik |
edition | 1. ed. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>00000nam a2200000 c 4500</leader><controlfield tag="001">BV041251460</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20131125</controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">130902s2013 ad|| |||| 00||| eng d</controlfield><datafield tag="015" ind1=" " ind2=" "><subfield code="a">13,N28</subfield><subfield code="2">dnb</subfield></datafield><datafield tag="016" ind1="7" ind2=" "><subfield code="a">1036703932</subfield><subfield code="2">DE-101</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781449335946</subfield><subfield code="c">: EUR 31.99 (DE) (freier Pr.), EUR 32.90 (AT) (freier Pr.)</subfield><subfield code="9">978-1-449-33594-6</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">1449335942</subfield><subfield code="9">1-449-33594-2</subfield></datafield><datafield tag="024" ind1="3" ind2=" "><subfield code="a">9781449335946</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)862800173</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)DNB1036703932</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rakddb</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-29T</subfield><subfield code="a">DE-11</subfield><subfield code="a">DE-91G</subfield><subfield code="a">DE-706</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">004</subfield><subfield code="2">sdnb</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 362f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Marlow, Simon</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)104224538X</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Parallel and concurrent programming in Haskell</subfield><subfield code="b">[techniques for multicore and multithreaded programming]</subfield><subfield code="c">Simon Marlow</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">1. ed.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Beijing [u.a.]</subfield><subfield code="b">O'Reilly</subfield><subfield code="c">2013</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XIV, 304 S.</subfield><subfield code="b">Ill., graph. Darst.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">HASKELL</subfield><subfield code="0">(DE-588)4318275-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Parallelverarbeitung</subfield><subfield code="0">(DE-588)4075860-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Nebenläufigkeit</subfield><subfield code="0">(DE-588)4115352-2</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">HASKELL</subfield><subfield code="0">(DE-588)4318275-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Parallelverarbeitung</subfield><subfield code="0">(DE-588)4075860-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="2"><subfield code="a">Nebenläufigkeit</subfield><subfield code="0">(DE-588)4115352-2</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">X:MVB</subfield><subfield code="q">text/html</subfield><subfield code="u">http://deposit.dnb.de/cgi-bin/dokserv?id=4376825&prov=M&dok_var=1&dok_ext=htm</subfield><subfield code="3">Inhaltstext</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">HBZ Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026225492&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="943" ind1="1" ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-026225492</subfield></datafield></record></collection> |
id | DE-604.BV041251460 |
illustrated | Illustrated |
indexdate | 2024-08-03T00:54:12Z |
institution | BVB |
isbn | 9781449335946 1449335942 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-026225492 |
oclc_num | 862800173 |
open_access_boolean | |
owner | DE-29T DE-11 DE-91G DE-BY-TUM DE-706 |
owner_facet | DE-29T DE-11 DE-91G DE-BY-TUM DE-706 |
physical | XIV, 304 S. Ill., graph. Darst. |
publishDate | 2013 |
publishDateSearch | 2013 |
publishDateSort | 2013 |
publisher | O'Reilly |
record_format | marc |
spelling | Marlow, Simon Verfasser (DE-588)104224538X aut Parallel and concurrent programming in Haskell [techniques for multicore and multithreaded programming] Simon Marlow 1. ed. Beijing [u.a.] O'Reilly 2013 XIV, 304 S. Ill., graph. Darst. txt rdacontent n rdamedia nc rdacarrier HASKELL (DE-588)4318275-6 gnd rswk-swf Parallelverarbeitung (DE-588)4075860-6 gnd rswk-swf Nebenläufigkeit (DE-588)4115352-2 gnd rswk-swf HASKELL (DE-588)4318275-6 s Parallelverarbeitung (DE-588)4075860-6 s Nebenläufigkeit (DE-588)4115352-2 s DE-604 X:MVB text/html http://deposit.dnb.de/cgi-bin/dokserv?id=4376825&prov=M&dok_var=1&dok_ext=htm Inhaltstext HBZ Datenaustausch application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026225492&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Marlow, Simon Parallel and concurrent programming in Haskell [techniques for multicore and multithreaded programming] HASKELL (DE-588)4318275-6 gnd Parallelverarbeitung (DE-588)4075860-6 gnd Nebenläufigkeit (DE-588)4115352-2 gnd |
subject_GND | (DE-588)4318275-6 (DE-588)4075860-6 (DE-588)4115352-2 |
title | Parallel and concurrent programming in Haskell [techniques for multicore and multithreaded programming] |
title_auth | Parallel and concurrent programming in Haskell [techniques for multicore and multithreaded programming] |
title_exact_search | Parallel and concurrent programming in Haskell [techniques for multicore and multithreaded programming] |
title_full | Parallel and concurrent programming in Haskell [techniques for multicore and multithreaded programming] Simon Marlow |
title_fullStr | Parallel and concurrent programming in Haskell [techniques for multicore and multithreaded programming] Simon Marlow |
title_full_unstemmed | Parallel and concurrent programming in Haskell [techniques for multicore and multithreaded programming] Simon Marlow |
title_short | Parallel and concurrent programming in Haskell |
title_sort | parallel and concurrent programming in haskell techniques for multicore and multithreaded programming |
title_sub | [techniques for multicore and multithreaded programming] |
topic | HASKELL (DE-588)4318275-6 gnd Parallelverarbeitung (DE-588)4075860-6 gnd Nebenläufigkeit (DE-588)4115352-2 gnd |
topic_facet | HASKELL Parallelverarbeitung Nebenläufigkeit |
url | http://deposit.dnb.de/cgi-bin/dokserv?id=4376825&prov=M&dok_var=1&dok_ext=htm http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026225492&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT marlowsimon parallelandconcurrentprogramminginhaskelltechniquesformulticoreandmultithreadedprogramming |