14th Chapter Parallel Function Program

Source: Internet
Author: User

14th Chapter Parallel Function Program

This chapter describes

Simplifying parallelization with non-volatile data (parallelization)
Processing Task Parallel Libraries (Task Parallel Library)
Declaratively express parallelism in LINQ (parallelism)
Implementing the overloaded (overloaded) operator

In favor of functional programming arguments, we have seen many. One reason is that the degree of parallelism is now becoming more and more important. Writing can adapt to a large number of core code, compared with the typical command-style method, with a much easier function.
Two concepts from the functional world are essential, parallel computing is declarative programming style, and the use of immutable data structures is closely related. When using immutable data, the code becomes more declarative because the code is more concerned with the expected results than copying and altering the details of the data. Both concepts are important to achieve parallelization in different ways.
With declarative styles, most code can easily parallelize collections, because declarative styles do not describe how the code works, so that, without much effort, you can replace the serial in parallel. Immutable data structures and function without side effects are important because the code has no side effects, and we can easily determine which code does not depend on each other. By doing this, you can run code snippets in parallel using task-based parallelism. Both C # and F # can use mutable data types, and in the tenth chapter we learn how to hide mutable states and make the whole program functional. In some cases, for example, if an array is handled in some way, this hidden command-isolated code can also be easily parallelized.
It can be found that there are many things worth studying. We start with a brief demonstration of all these techniques and explain the use of each one. After that, look at two more complex sample applications, demonstrating the use of parallel functional programming for large-scale applications. We cannot accommodate two complete examples of code in a chapter, and in the book we omit some of the less significant details, and we will pay particular attention to the areas of architecture, directly related to parallelism. From the book's website you can get the complete source code, which complements the missing part.

14th Chapter Parallel Function Program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.