この記事は検証可能な参考文献や出典が全く示されていないか、不十分です。出典を追加して記事の信頼性向上にご協力ください。(このテンプレートの使い方)
出典検索?: "プロセス間通信"
プロセス間通信(プロセスかんつうしん、IPC、英: interprocess communication)はコンピュータの動作において、複数プロセス(の複数スレッド)間でデータをやりとりする仕組み。通信プロセスは、同一コンピュータ内で帰結するローカル、ネットワーク接続された別のコンピュータと相互にリモート、などのほかに多様な観点で分類され、スレッド間の通信帯域幅とレイテンシや扱うデータの種類も多種多様である。メッセージパッシング、同期、共有メモリ、RPCなどのメカニズムやプリミティブがある。
プロセス間通信の目的と理由は
情報の共有
計算の高速化
モジュール性の向上
利便性
特権分離(英語版)
であり、「スレッド間通信」や「アプリケーション間通信」と呼ぶこともある。
IPCとアドレス空間のコンセプトの組合せは、アドレス空間分離の基盤である[1]。 技法提供しているオペレーティングシステムや環境 IPCとして使われているAPIはいくつかある。プラットフォームに依存しない主なAPIの例を挙げる。
主なIPC技法
ファイル多くのOS
シグナル多くのOS。WindowsではCのランタイムライブラリでのみ実装しており、IPCとしての利用は推奨していない[要出典]。
メッセージキュー多くのOS
ソケット多くのOS
UNIXドメインソケットPOSIX準拠システム
パイプPOSIX準拠システム、Windows
名前付きパイプPOSIX準拠システム、Windows
セマフォPOSIX準拠システム、Windows
共有メモリPOSIX準拠システム、Windows
メモリマップトファイルPOSIX準拠システム、Windows
メッセージパッシング
(shared nothing)MPI パラダイム、Java RMI、CORBA、MSMQ
BinderAndroid
実装例
無名パイプ
Common Object Request Broker Architecture (CORBA)
Freedesktop.orgのD-Bus
Distributed Computing Environment (DCE)
メッセージバス (Mbus) - .mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation.cs-ja1 q,.mw-parser-output .citation.cs-ja2 q{quotes:"「""」""『""』"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free a,.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited a,.mw-parser-output .id-lock-registration a,.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription a,.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:#d33}.mw-parser-output .cs1-visible-error{color:#d33}.mw-parser-output .cs1-maint{display:none;color:#3a3;margin-left:0.3em}.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}RFC 3259 にて規定
MCAPI (Multicore Communications API)
Lightweight Communications and Marshalling (LCM)
ONC RPC
UNIXドメインソケット
XML: XML-RPC や SOAP
JSON: JSON-RPC
Thrift
TIPC (TIPC)
ZeroCの Internet Communications Engine (ICE)
以下は、プラットフォーム固有またはプログラミング言語固有のAPIの例である。
Appleの Apple event(従来は Interapplication Communications、IAC と呼ばれていた)
Eneaの LINX - Linux向け(オープンソース)と Enea OSE で動作するバージョンがある。
CMUによるIPC実装[2]
Javaの Remote Method Invocation (RMI)
KDEの Desktop Communications Protocol (DCOP)
Libt2n - Linux上のC++でのみ動作。複雑なオブジェクトや例外を扱える。
Machカーネルの Mach ポート
マイクロソフトの ActiveX、Component Object Model (COM)、Microsoft Transaction Server (COM+)、Distributed Component Object Model (DCOM)、動的データ交換 (DDE)、Object Linking and Embedding (OLE)、匿名パイプ(英語版)、名前付きパイプ、Local Procedure Call(英語版)、MailSlot(英語版)、メッセージループ(英語版)、MSRPC(英語版)、.NET Remoting、Windows Communication Foundation (WCF)
ノベルの SPX
PHPのセッション
POSIX: mmap、メッセージキュー、セマフォ、共有メモリ
RISC OSのメッセージ
Solaris Doors
System V: メッセージキュー、セマフォ、共有メモリ
Distributed Ruby
DIPC (Distributed Inter-Process Communication) - Linux上で System V 系IPCをネットワークにまで拡張する仕組み
OpenBinder - BeOSが起源で、最近ではAndroidで使われている。