Chapter 4. The Execution System


As noted earlier, the CLR consists of three subsystems: the type and metadata systems (covered in Chapters 2 and 3, respectively) and the execution system (the focus of this chapter). The execution system is primarily responsible for the controlled execution of programs that contain managed code. For example, one responsibility of the execution system, and possibly the most immediately obvious, is the just-in-time (JIT) compilation of Common Intermediate Language/Intermediate Language (CIL/IL) to native code for the current execution platform. However, the execution system accomplishes much more than just JIT compilation; for example, it ensures that executing code meets the system's security requirements.

Many important requirements affect the design of the execution system. A primary design goal for the execution system was that it not be tied to any specific hardware or software platform. Therefore, the execution model makes no assumptions about the hardware architecture or operating system services available to it. This flexibility makes porting the CLR to other execution environments ”such as the Pocket PC, BSD UNIX, and mobile telephones ”a simpler task.

This chapter describes how the CLR executes programs. It discusses the concepts related to execution, such as the CIL, JIT compilation, application domains, and security. The term "application domain" is probably new to most readers. In earlier chapters, you saw how assemblies are similar to DLLs but more powerful, thanks to concepts such as versioning and culture information. Just as assemblies build on and extend the concepts associated with DLLs, so application domains build on and extend the concept of a process. Application domains can be thought of as subprocesses within a process. They provide the same facilities as traditional processes, such as memory isolation. In general, however, a process is a heavy operating system entity; application domains provide logical processes at a much lower cost.

This chapter begins with an overview of the execution system, comparing it to other component models. Next comes an overview of the CIL, its structure, and its execution model. The concepts and use of application domains are then introduced. The chapter concludes with an overview of the security system, which highlights how it is integrated into the execution system.



Programming in the .NET Environment
Programming in the .NET Environment
ISBN: 0201770180
EAN: 2147483647
Year: 2002
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net