• Anelli nell'io

    “Sospesi a metà tra l’inconcepibile immensità cosmica dello spazio-tempo relativistico e il guizzare elusivo e indistinto di cariche quantiche, noi esseri umani, più simili ad arcobaleni e miraggi che ad architravi o macigni, siamo imprevedibili poemi che scrivono se stessi – vaghi, metaforici, ambigui, e a volte straordinariamente belli.”
    Douglas Hofstadter
  • Caos

    La relatività eliminò l'illusione newtoniana dello spazio e tempo assoluti;
    la teoria quantistica eliminò il sogno newtoniano di un processo di misurazione controllabile;
    il caos elimina la fantasia laplaciana della prevedibilità deterministica.

    Joseph Ford - "What is Chaos, that we should be mindful of it?"
  • Developer

    Il programmatore di computer è un creatore di universi per i quali è il solo legislatore. Non c'è commediografo, regista o imperatore, per quanto potente, che abbia mai esercitato una autorità così assoluta da disporre un palcoscenico o un campo di battaglia e da comandare attori o truppe altrettanto incorruttibilmente obbedienti.
    Joseph Weizenbaum
  • Patience

    Patience is a virtue, Savannah.
    To tolerate delay.
    It implies self-control and forbearance, as opposed to wanting what we want when we want it.
    Something to think about.

    Catherine Weaver - The Sarah Connor Chronicles
  • Computer Science

    La Computer Science riguarda i computer non più di quanto l'astronomia riguarda i telescopi.

    E.W. Dijkstra
parallel_query

This document provides a detailed and in-depth tour of support in the Microsoft® .NET Framework 4 for parallel programming. This includes an examination of common parallel patterns and how they’re implemented without and with this new support in the .NET Framework, as well as covering best practices for developing parallel components utilizing parallel patterns.

Patterns are everywhere, yielding software development best practices and helping to seed new generations of developers with immediate knowledge of established directions on a wide array of problem spaces. Patterns represent successful (or in the case of anti-patterns, unsuccessful) repeated and common solutions developers have applied time and again in particular architectural and programming domains. Over time, these tried and true practices find themselves with names, stature, and variations, helping further to proliferate their application and to jumpstart many a project.

Patterns don’t just manifest at the macro level. Whereas design patterns typically cover architectural structure or methodologies, coding patterns and building blocks also emerge, representing typical ways of implementing a specific mechanism. Such patterns typically become ingrained in our psyche, and we code with them on a daily basis without even thinking about it. These patterns represent solutions to common tasks we encounter repeatedly.

Of course, finding good patterns can happen only after many successful and failed attempts at solutions. Thus for new problem spaces, it can take some time for them to gain a reputation. Such is where our industry lies today with regards to patterns for parallel programming. While developers in high-performance computing have had to develop solutions for supercomputers and clusters for decades, the need for such experiences has only recently found its way to personal computing, as multi-core machines have become the norm for everyday users. As we move forward with multi-core into the manycore era, ensuring that all software is written with as much parallelism and scalability in mind is crucial to the future of the computing industry. This makes patterns in the parallel computing space critical to that same future.

“In  general,  a  ‘multi-core’  chip  refers  to  eight  or  fewer  homogeneous  cores  in  one microprocessor  package, whereas  a  ‘manycore’  chip  has more  than  eight  possibly heterogeneous cores in one microprocessor package. In a manycore system, all cores share the resources and services, including memory and disk access, provided by the operating system.”  –The Manycore Shift, (Microsoft Corp., 2007)

In the .NET Framework 4, a slew of new support has been added to handle common needs in parallel programming, to help developers tackle the difficult problem that is programming for multi-core and manycore. Parallel programming is difficult for many reasons and is fraught with perils most developers haven’t had to experience. Issues of races, deadlocks, livelocks, priority inversions, two-step dances, and lock convoys typically have no place in a sequential world, and avoiding such issues makes quality patterns all the more important. This new support in the .NET Framework 4 provides support for key parallel patterns along with building blocks to help enable implementations of new ones that arise.

To that end, this document provides an in-depth tour of support in the .NET Framework 4 for parallel programming, common parallel patterns and how they’re implemented without and with this new support, and best practices for developing parallel components in this brave new world.

This document only minimally covers the subject of asynchrony for scalable, I/O-bound applications: instead, it focuses predominantly on applications of CPU-bound workloads and of workloads with a balance of both CPU and I/O activity. This document also does not cover Visual F# in Visual Studio 2010, which includes language-based support for several key parallel patterns.

Table of Contents

  • Introduction
  • Delightfully Parallel Loops
  • Fork/Join
  • Passing Data
  • Producer/Consumer
  • Aggregations
  • MapReduce
  • Dependencies
  • Data Sets of Unknown Size
  • Speculative Processing
  • Laziness
  • Shared State
  • Conclusion

Very interesting, LINQ oriented, declarative vs imperative phylosphy. Anti-patterns review. A must.


Categorie:
Vuoi condividere questo post? | | Google Reader | del.icio.us | E-mail | Permalink
Comments are closed
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.© Copyright 2012 Mauro Bellati