C# Deconstructed (eBook)
X, 172 Seiten
Apress (Verlag)
978-1-4302-6671-6 (ISBN)
To answer this question we will dig ever deeper into the structure of the C# language and the onion-skin abstraction layers of the .NET Framework that underpins it. Well follow the execution thread downwards, first to MSIL (Microsoft Intermediate Language) then down through just-in-time compilation into Machine Code before finally seeing the results executed at the hardware level.
The aim of this deep-dive is to provide you with a much more rounded knowledge of the environment within which you code exists. As a managed language, its best-practice to let the Framework deal with device interaction but youll find the experience of taking the cover off once in a while a very rewarding one that will greatly enrich your appreciate of the C# language and the way in which in functions.
Mohammad Rahman is a computerprogrammer. He has been aprogrammer since 1998 and for the past seven years he has been designingdesktop and web-based systems for private and government agencies using C# language in Microsoft.NET. Currently he is working as acomputer programmer and earning his doctorate as a part-time student at the University ofCanberra, Australia.
C# Deconstructed answers a seemingly simply question: Just what is going on, exactly, when you run C# code on the .NET Framework? To answer this question we will dig ever deeper into the structure of the C# language and the onion-skin abstraction layers of the .NET Framework that underpins it. Well follow the execution thread downwards, first to MSIL (Microsoft Intermediate Language) then down through just-in-time compilation into Machine Code before finally seeing the results executed at the hardware level. The aim of this deep-dive is to provide you with a much more rounded knowledge of the environment within which you code exists. As a managed language, its best-practice to let the Framework deal with device interaction but youll find the experience of taking the cover off once in a while a very rewarding one that will greatly enrich your appreciate of the C# language and the way in which in functions.
Mohammad Rahman is a computerprogrammer. He has been aprogrammer since 1998 and for the past seven years he has been designingdesktop and web-based systems for private and government agencies using C# language in Microsoft.NET. Currently he is working as acomputer programmer and earning his doctorate as a part-time student at the University ofCanberra, Australia.
Contents at a Glance 3
Contents 160
About the Author 164
About the Technical Reviewer 165
Chapter 1: Introduction to Programming Language 4
Overview of the CPU 4
Instruction Set Architecture of a CPU 7
Memory: Where the CPU Stores Temporary Information 8
Concept of the OS 9
Concept of the Process 11
Concept of the Thread 12
What Is Virtualization? 12
Programming Language 13
Compilation and Interpretation 13
Birth of C# Language and JIT Compilation 13
// Microsoft (R) .NET Framework IL Disassembler Version 4.0.30319.1 16
The CLR 19
Road Map to the CLR 20
Tools Used in This Book 25
Son of Strike Debugging Extension DLL 26
Conclusion 27
Further Reading 27
Chapter 2: The Virtual Machine and CLR 28
Virtual Machine 28
Problems with the Existing System 28
Optimization During Execution 29
Virtual Execution Environment 31
Components of the Virtual Execution Environment 32
CLR: Virtual Machine for .NET 32
CLR Supports Multiple Languages 33
Common Components of the CLR 39
Conclusion 40
Further Reading 40
Chapter 3: Assembly 41
What Is the Assembly? 41
Overview of Modules, Assemblies, and Files 42
Introduction to PE Files 43
Structure of the Assembly 44
Analysis of the Assembly 51
Section Header 53
.text Section 55
#~ stream 57
ModuleDef 58
TypeDef 58
MethodDef 58
Reference Tables 58
AssemblyRef 58
ModuleRef 58
TypeRef 58
MemberRef 59
Assembly Loading 60
Inside the Bind, Map, Load Process 61
Binding to an Assembly 61
Consulting the Cache 61
Conclusion 62
Further Reading 62
Chapter 4: CLR Memory Model 63
Introduction 63
Memory Interaction between the CLR and OS 64
Windows Memory Management 66
Concept of the Process 67
Process Structure 68
Process Address Space 69
Concept of the Thread 71
Thread Address Space 74
Thread and Frames 74
Concept of the Virtual Memory 74
32-bit and 64-bit Process Addressing 75
Virtual-to-Physical Address Mapping 79
Learn the Contents of a Particular Physical Memory Address 80
Find a Virtual Address and Its Contents 81
Memory-Mapped File 82
Conclusion 88
Further Reading 88
Chapter 5: CLR Memory Model II 89
CLR Memory Model: Application Domain 89
Finding an object in the Application Domain 94
Address Space of the Application Domain 95
Stack in the CLR 98
Address Space of the Stack 102
Heap 104
Heap and Address Space 106
objects 107
Garbage Collection 110
Generation 0 111
Generation 1 111
Generation 2 111
Conclusion 112
Further Reading 112
Chapter 6: CLR Execution Model 113
Overview of the CLR 113
The C# Program and the CLR 117
CLR Bootstrapping 122
CLR Address Space 126
Class Loader in the CLR 130
Locating the Main Entry Point 130
Stub Code for the Classes 131
Verification 132
Conclusion 132
Further Reading 132
Chapter 7: CLR Execution Model II 133
JIT Compilation 133
Method Stub of a Type 133
JIT-Compiled Status: NONE 135
JIT-Compiled Status: JIT 139
JIT-Compiled Status: PreJIT 142
How Many Times a Method Is JIT Compiled 145
Execution State of the CLR 145
Conclusion 153
Further Reading 153
Index 154
| Erscheint lt. Verlag | 30.9.2014 |
|---|---|
| Zusatzinfo | X, 172 p. 43 illus. |
| Verlagsort | Berkeley |
| Sprache | englisch |
| Themenwelt | Mathematik / Informatik ► Informatik ► Software Entwicklung |
| Mathematik / Informatik ► Informatik ► Theorie / Studium | |
| ISBN-10 | 1-4302-6671-6 / 1430266716 |
| ISBN-13 | 978-1-4302-6671-6 / 9781430266716 |
| Informationen gemäß Produktsicherheitsverordnung (GPSR) | |
| Haben Sie eine Frage zum Produkt? |
DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasserzeichen und ist damit für Sie personalisiert. Bei einer missbräuchlichen Weitergabe des eBooks an Dritte ist eine Rückverfolgung an die Quelle möglich.
Dateiformat: PDF (Portable Document Format)
Mit einem festen Seitenlayout eignet sich die PDF besonders für Fachbücher mit Spalten, Tabellen und Abbildungen. Eine PDF kann auf fast allen Geräten angezeigt werden, ist aber für kleine Displays (Smartphone, eReader) nur eingeschränkt geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich