「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。 -[[戻る>その他、開発の色々]] * 目次 [#ucb91276] #contents *概要 [#tf883ba7] プロセス間通信について *詳細 [#d40d71c8] **基本 [#w62e240d] -共有メモリ、パイプ(名前付き/匿名)、UDP/TCPなどがある。 -子プロセスとの通信なら匿名パイプを使用すると良い。 ***共有メモリ [#z4db4fcf] 内部的には、ページングファイルに支持されたメモリマップド・ファイルを使用する。 ***パイプ [#t693fdb4] -名前付きパイプ --名前付きパイプを使用して、プロセス間通信を行う場合、~ パイプ・オブジェクトの始点と終端を2プロセス間で持つ。 --このとき、パイプ・オブジェクトをIDのようなもので~ 識別するのが、名前付きパイプになる。 --従って、名前付きパイプの場合、~ 2プロセスがパイプ名を共有している必要がある。 -匿名パイプ --一方、匿名パイプは、名前が無いので、名前で共有できない。 --その代りに、親側から、子側に、ハンドラを複製して渡す。 --このハンドラの複製に、 ---Windows OSでは、DuplicateHandle関数を使用し、 ---Unix系OSでは、fork関数を使用する。 --.NETでは、このハンドラの複製に、~ https://github.com/OpenTouryoProject/SampleProgram/blob/master/Other/PipesFamilyHouse/AnonymousPipe/Parent/Program.cs#L77~ HandleInheritability.Inheritableを使用している。~ これは、内部(Win32)的に、DuplicateHandle関数と思われる。 -参考 --[ C言語 ] プロセスの生成 ( fork ) と パイプによる~ プロセス間通信 ( pipe ) – 行け!偏差値40プログラマー~ http://hensa40.cutegirl.jp/archives/1032 ***UDP [#g9cdf481] コネクションレス型の通信 ***TCP [#e54d5a5e] コネクション型の通信 **その他 [#z2424263] ***[[RPC]] [#c07b83ee] ***[[ウィンドウ・システム]] > [[ウィンドウ メッセージ]] [#dbcee084] *参考 [#v50a11dd] **OpenTouryoProject/SampleProgram · GitHub [#offaeb4a] -SampleProgram/Other/InterProcComm at master~ https://github.com/OpenTouryoProject/SampleProgram/tree/master/Other/InterProcComm --[[SharedMem.xaml.cs>https://github.com/OpenTouryoProject/SampleProgram/blob/master/Other/InterProcComm/SharedMem.xaml.cs]] --[[NdPipe.xaml.cs>https://github.com/OpenTouryoProject/SampleProgram/blob/master/Other/InterProcComm/NdPipe.xaml.cs]] --[[UDP.xaml.cs>https://github.com/OpenTouryoProject/SampleProgram/blob/master/Other/InterProcComm/UDP.xaml.cs]] --[[TCP.xaml.cs>https://github.com/OpenTouryoProject/SampleProgram/blob/master/Other/InterProcComm/TCP.xaml.cs]] -SampleProgram/Other/PipesFamilyHouse at master~ https://github.com/OpenTouryoProject/SampleProgram/tree/master/Other/PipesFamilyHouse --AnonymousPipe(匿名パイプによる親子プロセス間通信) --StdIOAndPipe(標準入出力による親子プロセス間通信) ---- Tags: [[:プログラミング]], [[:その他、開発の色々]], [[:.NET開発]]