CLR via C# (4th Edition)

Jeffrey RichterTsinghua University Press2015

Rating 4.7
Word count
1M words
Chapters
36
Series
CLR via C# (4th Edition) is a classic technical monograph by Jeffrey Richter. The Chinese edition was translated by Zhou Jing and fully updated for .NET Framework 4.5 and Visual Studio 2012, offering an in-depth explanation of how the Common Language Runtime (CLR) works. The book is divided into five parts and about thirty chapters. Part I covers CLR fundamentals, including the execution model, as well as generating, packaging, deploying, and managing assemblies and shared assemblies, and strongly named assemblies. Part II covers type design, including type fundamentals; primitive, reference, and value types; type and member fundamentals; constants and fields; methods; parameters; properties; events; generics; and interfaces. Part III covers basic types, including characters, strings, and text processing; enumerated types and bit flags; arrays; delegates; custom attributes; and nullable value types. Part IV delves into core mechanisms, discussing exceptions and state management, the managed heap and garbage collection, CLR hosting and AppDomains, assembly loading and reflection, runtime serialization, and interoperability with WinRT components. Part V is devoted to threading, from threading fundamentals and compute-bound and I/O-bound asynchronous operations to primitive and hybrid thread synchronization constructs. In a "know not just what but why" manner, the author explains type layout, memory allocation, JIT compilation, GC collection, thread synchronization, and other low-level mechanisms very thoroughly, with numerous runnable examples to help readers write high-performance, reliable, and maintainable .NET applications.
ISBN
9787302380979

Tags

Computing Programming Garbage CollectionMultithreadingWorking MechanismPerformance TuningTechnical MonographCore MechanicsGenericsProgramming DesignAcademic Monograph

Summary

CLR via C# (4th Edition) is a classic technical monograph by Jeffrey Richter. The Chinese edition, translated by Zhou Jing, has been comprehensively updated for .NET Framework 4.5 and Visual Studio 2012, offering an in-depth exploration of how the Common Language Runtime (CLR) works. The book is divided into five parts and approximately thirty chapters. Part I covers the fundamentals of the CLR, including the execution model, assembly generation, packaging, deployment, shared assemblies, and strongly named assemblies. Part II addresses type design, covering type fundamentals, primitive types, reference types and value types, type and member basics, constants and fields, methods, parameters, properties, events, generics, and interfaces. Part III discusses primitive types, including characters, strings, and text processing, enumerated types and bit flags, arrays, delegates, custom attributes, and nullable value types. Part IV delves into core mechanisms, discussing exceptions and state management, the managed heap and garbage collection, CLR hosting and AppDomains, assembly loading and reflection, runtime serialization, and interoperability with WinRT components. Part V is devoted to threading, ranging from threading basics and asynchronous operations for compute-bound and I/O-bound work to primitive and hybrid thread synchronization constructs. In a manner that reveals not just what happens but why, the author thoroughly explains underlying mechanisms such as type layout, memory allocation, JIT compilation, garbage collection, and thread synchronization, supplemented by numerous runnable examples that help readers build high-performance, reliable, and maintainable .NET applications.

Editor's review

很多 C# 开发者会写语法,却说不清一行代码在 CLR 里究竟发生了什么:对象在哪分配、字段如何布局、虚方法怎么派发、GC 何时回收、async 方法被编译成了什么。这本书回答的正是这些问题。Jeffrey Richter 是 Wintellect 联合创始人,也是长期为微软 .NET 团队提供咨询的资深专家,他讲机制时不堆砌术语,而是从“运行时设计者为什么这样选”切入,一层层揭开类型加载、JIT 编译、托管堆、垃圾回收、线程同步的实现细节,并配以示例与实验代码。周靖的译文严谨准确,术语处理统一,读起来顺畅。第 4 版按 .NET Framework 4.5 修订,新增与 WinRT 组件互操作的内容,重写了反射 API 与异步编程部分,并同步了 C# 5.0 的 async/await 模型,还提供了配套源代码。它不是教你“怎么用 API”的速查手册,而是帮你建立 CLR 心智模型的长期参考书;读透之后,排查内存泄漏、线程死锁和性能瓶颈时,你会知道该往哪里看。

Who it's for

A good fit for

Not a good fit for

Reading tips

  1. 先通读第Ⅰ、Ⅱ部分,建立 CLR 执行模型和类型系统的整体图景,再按需精读后续章节
  2. 边读边对照配套源代码,在调试器里查看类型布局、IL 与 JIT 后的代码,理解才更扎实
  3. 第Ⅳ、Ⅴ部分(GC、线程同步、异步)篇幅重、难度高,建议分多次读,配合小型实验验证
  4. 把本书当工具书常备手边,遇到内存或并发问题时按章回查,比从头到尾读一遍更有收获

About the publisher

Tsinghua University Press China · Founded in 1980

Founded in 1980, Tsinghua University Press has 57 titles in our collection, covering popular science, medicine, health, law, philosophy and social sciences. Representative works include medical popular-science books such as Cancer Truth: Doctors Are Reading It Too and New Knowledge on Cancer by Bo Luo (Li Zhizhong), legal titles such as Sunshine Is the Best Preservative: Express Delivery of Major Global Anti-Corruption Cases, and works like Qi Ge's A Brief History of Philosophy with Big Ideas and Liu Yunhao's From the Internet to a New Industrial Revolution. Its authors include science writers, medical researchers, the Renmin University of China anti-corruption master's class and university scholars, reflecting a publishing profile that balances academic seriousness with accessible reading. As public information is limited, this profile is based only on the titles in our collection.

Contents

  1. Part I CLR Fundamentals
  2. Chapter 1 The CLR's Execution Model
  3. Chapter 2 Building, Packaging, Deploying, and Managing Applications and Types
  4. Chapter 3 Shared Assemblies and Strongly Named Assemblies
  5. Part II Designing Types
  6. Chapter 4 Type Fundamentals
  7. Chapter 5 Primitive, Reference, and Value Types
  8. Chapter 6 Type and Member Fundamentals
  9. Chapter 7 Constants and Fields
  10. Chapter 8 Methods
  11. Chapter 9 Parameters
  12. Chapter 10 Properties
  13. Chapter 11 Events
  14. Chapter 12 Generics
  15. Chapter 13 Interfaces
  16. Part III Essential Types
  17. Chapter 14 Characters, Strings, and Text Processing
  18. Chapter 15 Enumerated Types and Bit Flags
  19. Chapter 16 Arrays
  20. Chapter 17 Delegates
  21. Chapter 18 Custom Attributes
  22. Chapter 19 Nullable Value Types
  23. Part IV Core Mechanisms
  24. Chapter 20 Exceptions and State Management
  25. Chapter 21 The Managed Heap and Garbage Collection
  26. Chapter 22 CLR Hosting and AppDomains
  27. Chapter 23 Assembly Loading and Reflection
  28. Chapter 24 Runtime Serialization
  29. Chapter 25 Interoperating with WinRT Components
  30. Part V Threading
  31. Chapter 26 Threading Fundamentals
  32. Chapter 27 Compute-Bound Asynchronous Operations
  33. Chapter 28 I/O-Bound Asynchronous Operations
  34. Chapter 29 Primitive Thread Synchronization Constructs
  35. Chapter 30 Hybrid Thread Synchronization Constructs
  36. Translator's Afterword

FAQ

这本书适合零基础学 C# 的人吗? 不太适合。本书假设读者已掌握 C# 基本语法,重点讲 CLR 内部机制,缺少语言入门内容。零基础读者宜先找一本 C# 入门书,写完一些实际程序后再读本书。
第4版和第3版有什么区别? 第4版依据 .NET Framework 4.5 和 Visual Studio 2012 全面修订,新增与 WinRT 组件互操作一章,重写程序集加载与反射、序列化等章节,并同步 C# 5.0 的异步编程模型,篇幅也有所增加。
书里的知识对 .NET Core / .NET 5+ 还有用吗? 核心机制依然适用。类型布局、JIT、托管堆、GC 分代、线程同步构造等原理在 .NET Core 及后续版本中一脉相承;只是运行时寄宿、AppDomain、WinRT 互操作等章节已明显过时,阅读时需对照新版本甄别。
需要按顺序从头读到尾吗? 不必。建议先读第Ⅰ、Ⅱ部分打底,之后按兴趣或工作需要跳读。线程处理和垃圾回收章节相对独立,可单独精读;反射、序列化等章节可在做相关项目时查阅。
是否需要配合反编译或调试工具阅读? 强烈建议。配合 ILSpy、dotPeek 等工具查看编译器生成的 IL,或在调试器中观察对象布局与 GC 行为,能把书中抽象描述变成具体印象,理解效率会明显提高。

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

Jeffrey Richter Author

Jeffrey Richter is an author of computer technology books; his work CLR via C# (4th Edition) is categorized in the library under computing and programming design. Public information about his nationality, birth and death dates, and other personal details is limited. This representative work shows that he focuses on the .NET platform and the C# language, with particular attention to the internals of the Common Language Runtime (CLR), such as the type system, memory management, garbage collection, and concurrency. His writing is known for in-depth technical analysis and practice-oriented examples, aimed at developers who want to move from using the language to understanding the platform. For Chinese readers, such content helps build a complete picture of how .NET works at runtime and therefore offers reference value in technical programming reading.