CLR与执行中的流程之间的通信 [英] Communication between CLR and process under execution

查看:88
本文介绍了CLR与执行中的流程之间的通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CLR和我们的过程位于不同的地址空间.
因此,每个进程都是隔离的,并且驻留在单独的地址空间中.
但是我们的流程需要CLR服务,例如类加载,jit,gc等.所以我的问题是:
1>我们是否需要在进程和CLR之间建立IPC机制?

CLR and our process are at different address space.
So each process is isolated and resides at separate address space .
But our process needs services of CLR like class loading,jit,gc etc. So my questions are:
1>is we require IPC mechanism between our process and CLR?

推荐答案

让Windows API保留Windows句柄,而Windows API本身就是IPC,是传统的一个是从旧的Windows(不是操作系统)继承而来的,并且进程没有隔离.

您缺少的一件事是数据交换需要IPC,但OS API调用不需要IPC.因此,大多数呼叫对IPC无效.首先,让我们从方程式中排除CLR. MSIL代码已经JIT编译后,所有与OS的交互都将完成.结果,MSIL代码被编译成本机代码,然后直接调用本机Windows API(或其他平台的API),因为MSIL代码可以在许多其他平台(Linux或Mac OS X)上工作,在这些平台上CLR实现是已安装,例如Mono).现在,大多数调用都与调用者的进程有关,并且只处理映射在调用进程上的地址空间.不涉及IPC.

IPC主要用于处理Windows消息,…是应用程序进程调用OS的IPC功能的情况.实际上,据我所知,即使OS内核与应用程序进程之间的数据交换也不称为IPC,它是应用程序级进程之间的数据交换.另一方面,操作系统的大部分由应用程序级代码组成.

—SA
Let''s set aside Windows API with Windows handles, which is itself an IPC, a legacy one inherited from the old Windows when it was not an OS, and processes were not isolated.

One thing you are missing is that IPC is needed for data exchange, but not for the OS API calls. So, most calls do nothing about IPC. First of all, let''s exclude CLR from the equation. All interaction with OS is done after the MSIL code is already JIT-compiled. As a result, the MSIL code is compiled into native code, which in tern directly calls native Windows API (or API of other platforms, because MSIL code can work on many other platforms, line Linux or Mac OS X, where the CLR implementation is installed, like Mono). Now, most calls are related to the process of the caller and only deal with the address space mapped on the calling process. No IPC is involved.

IPC is mostly processing of Windows messages and… the cases when an application process calls IPC functions of the OS. Actually, as far as I know the terminology, even the data exchange between OS kernel and application processes is not called IPC, which is the data exchange between application-level processes. From the other hand, big part of OS consists of application-level code.

—SA


这篇关于CLR与执行中的流程之间的通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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