并行编程和多核编程有什么区别?
我认为这个话题已经说明了一切。并行编程和多核编程之间有什么区别(如果有的话)?谢谢。
I think the topic says it all. What's the difference, if any, between parallel and multicore programming? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
多核是并行编程的一种。特别是,它是一种 MIMD 设置,其中处理单元不是分布式的,而是共享一个公共存储区域,如果需要的话甚至可以像 MISD 设置一样共享数据。我相信它甚至与多处理不同,因为多核设置可以共享某种级别的缓存,因此比不同核心上的 CPU 更有效地协作。
一般并行编程还包括 SIMD 系统(如 GPU)和分布式系统。
Mutli-core is a kind of parallel programming. In particular, it is a kind of MIMD setup where the processing units aren't distributed, but rather share a common memory area, and can even share data like a MISD setup if need be. I believe it is even disctinct from multi-processing, in that a multi-core setup can share some level of caches, and thus cooperate more efficiently than CPUs on different cores.
General parallel programing would also include SIMD systems (like your GPU), and distributed systems.
区别不在于方法,而在于软件运行的硬件。并行编程正在解决一个问题并将工作负载分割成可以并行处理的更小的部分(分而治之类型的问题等)或可以彼此独立运行的函数。将该软件放置在多核硬件上,操作系统将对其进行优化以在不同的内核上运行。这使其具有更好的性能,因为您创建的用于执行并发工作的每个线程现在都可以在单个处理器/内核上运行,而无需消耗 CPU 周期。
The difference isn't in approach, just in the hardware the software runs on. Parallel programming is taking a problem and spliting the workload into smaller pieces that can be processed in parallel(Divide and Conquer type problems, etc.) or functions that can run independently of each other. Place that software on a multi-core piece of hardware and it will be optimized by the OS to run on the different cores. This gives it a better performance because each thread you create to do concurrent work can now run without consuming CPU cycles on a single processor/core.
多核系统是并行系统的子集。不同的系统将具有不同的内存架构,每个架构都有自己的挑战。一个系统如何处理缓存一致性?是否涉及NUMA等等
Multicore systems are a subset of parallel systems. Different systems will have different memory architectures, each with their own set of challenges. How does one system deal with cache coherency? Is NUMA involved, etc. etc.