使用fork()和IPC用C最有效的矩阵乘法 [英] Most efficient matrix multiplication in C using fork() and IPC

查看:359
本文介绍了使用fork()和IPC用C最有效的矩阵乘法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用多个进程里用C实现并行矩阵乘法。据我所知,因为每个进程都有自己的私有地址空间,我将不得不使用某种形式的进程间通信(IPC)的。我做了一些环顾四周,找不到未使用多线程的实现。我在想,如果有人知道去这是最最好的方法,或者使用共享内存,消息传递,或管道?我不要求一个解决方案,而是,如果有谁知道,这两种方法将与矩阵乘法更有效率。或者,如果有一个共同的标准的方式与多个进程来做到这一点?

I need to implement concurrent matrix multiplication in C using multiple processes. I understand that because each process has its own private address space, I will have to use some form of interprocess communication (IPC). I did some looking around and couldn't find many implementations that didn't use threads. I was wondering if anyone knew the most best way to go about this, either using shared memory, message passing, or pipes? I am not asking for a solution, but rather, if anyone knows, which of these methods will be more efficient with matrix multiplication. Or if there is a common standard way to do this with multiple processes?

推荐答案

同时处理矩阵乘法的最有效的方法是共享内存。通过这种方式,你不必通过管道/消息序列化的矩阵,可以直接适用于你的共享内存空间的乘法。

The most efficient way of concurrently processing matrix multiplications would be shared memory. In this way, you don't have to serialize your matrix through a pipe/message and you can directly apply your multiplications on your shared memory space.

这篇关于使用fork()和IPC用C最有效的矩阵乘法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆