当CLR与操作系统通信时 [英] When CLR communicates with operating system

查看:60
本文介绍了当CLR与操作系统通信时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!...



我有一个很大的疑问..因为CLR实际上需要操作系统的帮助才能运行asp.net应用程序记忆,希望有人帮助我....

Hi all!..

I have a big doubt.. as when CLR actually needs a help from Operating system to run the asp.net applications apart from memory, hoping somebody help me....

推荐答案

几乎无处不在。只有在CLI流程中只刷新一些托管数据时,才会触及OS API,换句话说,只使用CPU和托管资源。这可能是很多处理,并且整个应用程序几乎可以在该状态下运行,但这是罕见的情况。任何I / O,任何UI事件(更不用说WPF,但所有时间表格)都是通过操作系统完成的,不包括所有操作系统级别的杂务。



对于某些活动,问题它是通过操作系统完成的吗?目前尚不清楚。我刚才提到的WPF的例子就是这样一个例子。它基于DirectX,而不是基于GDI,并且只使用极少的Windows消息,仅在最高级别。但是什么是DirectX,操作系统的一部分?在某种程度上,是和否。它是可选的独立安装产品,但预装了操作系统。



即使是使用托管内存的操作。创建引用对象时会涉及托管内存管理和垃圾收集器,并最终收集垃圾。您的代码仅适用于托管内存管理。但它是如何在引擎盖下工作的?托管内存的管理必须最终解决操作系统堆API,以获取内存或将其返回到操作系统。这对您的应用程序完全透明,但答案是当CLR通信时?取决于这个问题的确切含义。我希望我能给你一些基本的想法。



-SA
Nearly everywhere. It is not touching OS API only if you only shuffle some managed data inside your CLI process, in other words, use only the CPU and managed resources. This can be a lot of processing, and the whole application can be in that state nearly all of its runtime, but this is a rare situation. Any I/O at all, any UI events (much less for WPF but all the time for Forms) is done through OS, not counting all the OS-level chores.

For some activities, the question "is it done via OS or not?" is not clearly certain. The example of WPF I just mentioned is one such example. It is based on DirectX, not on GDI and uses very little of Windows message pumping, only on the very top level. But what is DirectX, a part of OS or not? In a way, yes and no. It is the optional independently installed product, but preinstalled with the OS.

Even the operation with managed memory. The managed memory management and Garbage Collector are involved when you create reference objects, and the garbage is eventually collected. You code works only through the managed memory management. But how it works under the hood? The management of managed memory has to eventually address to the OS heap API, to get memory or the return it to the OS. This happens totally transparent to your application, but the answer "when CLR communicates?" depends on the exact meaning of this question. I hope I gave you some basic ideas.

—SA


这篇关于当CLR与操作系统通信时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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