Abstract
This practical tutorial introduces the features available in Haskell for writing parallel and concurrent programs. We first describe how to write semi-explicit parallel programs by using annotations to express opportunities for parallelism and to help control the granularity of parallelism for effective execution on modern operating systems and processors. We then describe the mechanisms provided by Haskell for writing explicitly parallel programs with a focus on the use of software transactional memory to help share information between threads. Finally, we show how nested data parallelism can be used to write deterministically parallel programs which allows programmers to use rich data types in data parallel programs which are automatically transformed into flat data parallel versions for efficient execution on multi-core processors.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Barnes, J., Hut, P.: A hierarchical O(n logn) force calculation algorithm. Nature 324 (December 1986)
Blelloch, G.: NESL: A nested data-parallel language (3.1). Technical Report CMU-CS-95-170, Carnegie Mellon University (September 1995)
Blelloch, G.: Programming parallel algorithms. Commun. ACM 39(3), 85–97 (1996)
Blelloch, G., Sabot, G.: Compiling collection-oriented languages onto massively parallel computers. Journal of Parallel and Distributed Computing 8, 119–134 (1990)
Chakravarty, M., Keller, G., Lechtchinsky, R., Pfannenstiel, W.: Nepal – nested data-parallelism in haskell. In: Sakellariou, R., Keane, J.A., Gurd, J.R., Freeman, L. (eds.) Euro-Par 2001. LNCS, vol. 2150, pp. 524–534. Springer, Heidelberg (2001)
Chakravarty, M., Keller, G., Peyton Jones, S.: Associated type synonyms. In: ACM SIGPLAN International Conference on Functional Programming (ICFP 2005), Tallinn, Estonia (2005)
Chakravarty, M., Leshchinskiy, R., Jones, S.P., Keller, G.: Data Parallel Haskell: a status report. In: ACM Sigplan Workshop on Declarative Aspects of Multicore Programming, Nice (January 2007)
Chakravarty, M.M., Keller, G.: More types for nested data parallel programming. In: ACM SIGPLAN International Conference on Functional Programming (ICFP 2000), Montreal, pp. 94–105. ACM Press, New York (2000)
Chakravarty, M.M., Leshchinskiy, R., Jones, S.P., Keller, G.: Partial vectorisation of Haskell programs. In: Proc. ACM Workshop on Declarative Aspects of Multicore Programming. ACM Press, San Francisco (2008)
Fluet, M., Rainey, M., Reppy, J., Shaw, A., Xiao, Y.: Manticore: A heterogeneous parallel language. In: ACM Sigplan Workshop on Declarative Aspects of Multicore Programming, Nice (January 2007)
Keller, G.: Transformation-based Implementation of Nested Data Parallelism for Distributed Memory Machines. PhD thesis, Technische Universite at Berlin, Fachbereich Informatik (1999)
Leshchinskiy, R.: Higher-order nested data parallelism: semantics and implementation. PhD thesis, Technical University of Berlin (2006)
Leshchinskiy, R., Chakravarty, M., Keller, G.: Costing nested array codes. Parallel Processing Letters 12, 249–266 (2002)
Leshchinskiy, R., Chakravarty, M.M., Keller, G.: Higher order flattening. In: Alexandrov, V.N., van Albada, G.D., Sloot, P.M.A., Dongarra, J. J. (eds.) ICCS 2006, Part II. LNCS, vol. 3992, pp. 920–928. Springer, Heidelberg (2006)
Mohr, E., Kranz, D.A., Halstead, R.H.: Lazy task creation – a technique for increasing the granularity of parallel programs. IEEE Transactions on Parallel and Distributed Systems 2(3) (July 1991)
O’Neill, M.: The genuine sieve of Eratosthenes. In: Submitted to JFP (2007)
Prins, J., Chatterjee, S., Simons, M.: Irregular computations in fortran: Expression and implementation strategies. Scientific Programming 7, 313–326 (1999)
Schrijvers, T., Jones, S.P., Chakravarty, M., Sulzmann, M.: Type checking with open type functions. In: Submitted to ICFP 2008 (2008)
Trinder, P., Loidl, H.-W., Barry, E., Hammond, K., Klusik, U., Peyton Jones, S., Rebón Portillo, Á.J.: The Multi-Architecture Performance of the Parallel Functional Language GPH. In: Bode, A., Ludwig, T., Karl, W.C., Wismüller, R. (eds.) Euro-Par 2000. LNCS, vol. 1900, p. 739. Springer, Heidelberg (2000)
Trinder, P., Loidl, H.-W., Pointon, R.F.: Parallel and Distributed Haskells. Journal of Functional Programming 12(5), 469–510 (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Peyton Jones, S., Singh, S. (2009). A Tutorial on Parallel and Concurrent Programming in Haskell. In: Koopman, P., Plasmeijer, R., Swierstra, D. (eds) Advanced Functional Programming. AFP 2008. Lecture Notes in Computer Science, vol 5832. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-04652-0_6
Download citation
DOI: https://doi.org/10.1007/978-3-642-04652-0_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-04651-3
Online ISBN: 978-3-642-04652-0
eBook Packages: Computer ScienceComputer Science (R0)