CHAPTER 1 The CLR’s Execution Model Flashcards

1
Q

What is CLR

A

a runtime that is usable by different and varied programming languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

core features of the CLR

A
memory management
assembly loading
security
exception handling
thread synchronization
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

managed modules

A

Compiling source code result

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

managed assemblies advantage

A

Data Execution Prevention

Address Space Layout Randomization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Parts of a Managed Module

A

PE32 or PE32+ header
CLR header
Metadata
IL code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

managed code

A

IL code is sometimes referred to as managed code because the CLR manages its execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Metadata usage

A

Metadata removes the need for native C/C++ header and library files when compiling

Microsoft Visual Studio uses metadata to help you write code

The CLR’s code verification process uses metadata to ensure that your code performs only “type-safe” operations

Metadata allows an object’s fields to be serialized into a memory block, sent to another machine, and then deserialized, re-creating the object’s state on the remote machine

Metadata allows the garbage collector to track the lifetime of objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

assembly

A

First, an assembly is a logical grouping of one or more modules or resource files.

Second, an assembly is the smallest unit of reuse, security, and versioning.

In the CLR world, an assembly is what we would call a component.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is IL

A

IL is a CPU-independent machine language

IL is a much higher-level language than most CPU machine languages.

IL as an object-oriented machine language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how executing assembly’s code

A

IL must first be converted to native CPU instructions. This is the job of the
CLR’s JIT (just-in-time) compiler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

IL verification

A

Verification examines the high-level IL code and ensures that everything the code does is safe。

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Unsafe code

A

Unsafe code is allowed to work
directly with memory addresses and can manipulate bytes at these addresses.

This is a very powerful feature and is typically useful when interoperating with unmanaged code or when you want to
improve the performance of a time-critical algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is NGen.exe tool

A

compile IL code to native code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

NGen.exe tool pro

A

Improving an application’s startup time

Reducing an application’s working set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

NGen.exe tool con

A

No intellectual property protection

NGen’d files can get out of sync

Inferior execution-time performance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

FCL

A

the Framework Class Library

17
Q

CTS

A

the Common Type System that describes

how types are defined and how they behave

18
Q

CLS

A

Common Language Specification that details for compiler vendors the minimum set of features their compilers must support if these compilers are to generate types compatible with other components written by other CLS-compliant languages on top of the CLR

19
Q

Interoperability with Unmanaged Code

A

Managed code can call an unmanaged function in a DLL

Managed code can use an existing COM component (server)

Unmanaged code can use a managed type (server)