Parallel Programming with Microsoft Visual C++

简介:
您的CPU计显示问题。一个核心正在100% 运行,但所有其他核心都处于空闲状态。您的应用程序是CPU绑定的,但您只使用了多核系统计算能力的一小部分。有没有办法获得更好的性能?
简而言之,答案是并行编程。您曾经编写过所有程序员都熟悉的顺序代码,现在您发现这不再符合您的性能目标。为了有效地使用系统的CPU资源,您需要将应用程序拆分为可以同时运行的部分。当然,这说起来容易做起来难。并行编程以专家领域和微妙的,难以复制的软件缺陷的雷区而闻名。每个人似乎都有一个最喜欢的故事,关于一个并行程序,由于一个神秘的错误,它的行为不像预期的那样。
这些故事应该激发您对编写自己的并行程序时将面临的问题的困难的健康尊重。幸运的是,救援已经到来。并行模式库 (PPL) 和异步代理库为并行性引入了新的编程模型,从而大大简化了作业。幕后是在多核架构上动态分配计算的复杂算法。此外,Microsoft Visual Studio开发系统包括调试和分析工具,以支持新的并行编程模型。
经过验证的设计模式是另一个帮助来源。本指南向您介绍最重要和最常用的并行编程模式,并使用PPL为它们提供可执行代码示例。在考虑从哪里开始时,一个很好的起点是回顾本书中的模式。查看您的问题是否具有与以下各章中介绍的六种模式相匹配的属性。如果是这样,请更深入地研究相关的一个或多个模式并研究示例代码。
英文简介:
Your CPU meter shows a problem. One core is running at 100 percent, but all the other cores are idle. Your application is CPU-bound, but you are using only a fraction of the computing power of your multicore system. Is there a way to get better performance?
The answer, in a nutshell, is parallel programming. Where you once would have written the kind of sequential code that is familiar to all programmers, you now find that this no longer meets your performance goals. To use your system's CPU resources efficiently, you need to split your application into pieces that can run at the same time. Of course, this is easier said than done. Parallel programming has a reputation for being the domain of experts and a minefield of subtle, hard-to-reproduce software defects. Everyone seems to have a favorite story about a parallel program that did not behave as expected because of a mysterious bug.
These stories should inspire a healthy respect for the difficulty of the problems you will face in writing your own parallel programs. Fortunately, help has arrived. The Parallel Patterns Library (PPL) and the Asynchronous Agents Library introduce a new programming model for parallelism that significantly simplifies the job. Behind the scenes are sophisticated algorithms that dynamically distribute computations on multicore architectures. In addition, Microsoft Visual Studio development system includes debugging and analysis tools to support the new parallel programming model.
Proven design patterns are another source of help. This guide introduces you to the most important and frequently used patterns of parallel programming and provides executable code samples for them, using PPL. When thinking about where to begin, a good place to start is to review the patterns in this book. See if your problem has any attributes that match the six patterns presented in the following chapters. If it does, delve more deeply into the relevant pattern or patterns and study the sample code.
- 书名
- Parallel Programming with Microsoft Visual C++
- 译名
- 使用 Microsoft Visual C++ 进行并行编程
- 语言
- 英语
- 年份
- 2019
- 页数
- 1499页
- 大小
- 7.90 MB
- 标签
- 并行编程
- C++
- 下载
Parallel Programming with Microsoft Visual C++.pdf
- 密码
- 65536
最后更新:2025-04-12 23:54:36