上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 28 下一页

2013年11月18日

技术人生:恶补基础知识

摘要: 背景最近觉得自己的基础知识出现瓶颈了,有必要好好补补,具体思路如下:恶补 .NET 知识:CLR VIA C#。恶补 C# 知识:C# IN DEPTH。恶补 数据结构:Data Structures Succinctly。恶补 数据库:待定。 阅读全文

posted @ 2013-11-18 10:43 幸福框架 阅读(274) 评论(0) 推荐(1) 编辑

2013年11月17日

.NET:CLR via C# User-Mode Constructs

摘要: The CLR guarantees that reads and writes to variables of the following data types are atomic: Boolean, Char, (S)Byte, (U)Int16, (U)Int32, (U)IntPtr, Single, and reference types. This means that all bytes within that variable are read from or written to all at once.Although atomic access to variable 阅读全文

posted @ 2013-11-17 10:36 幸福框架 阅读(642) 评论(0) 推荐(0) 编辑

2013年11月16日

.NET:CLR via C# The Interlocked Anything Pattern

摘要: Many people look at the Interlocked methods and wonder why Microsoft doesn't create a richer set of interlocked methods that can be used in a wider range of scenarios. For example, it would be nice if the Interlocked class offered Multiply, Divide, Minimum, Maximum, And, Or, Xor, and a bunch of 阅读全文

posted @ 2013-11-16 10:08 幸福框架 阅读(973) 评论(0) 推荐(0) 编辑

2013年11月15日

技术人生:三亚之行

摘要: 人生收获此次是公司组团去的三亚,地接的导游非常热情,如同大多数人一样,导游也会在这短短的几天内,尽可能的表现自己,此文聊聊导游说的三句话。旅游三不“较”:不比较不计较不睡觉人生何尝不是如此,我最大的痛苦就是来源于:比较和计较。照片一张 阅读全文

posted @ 2013-11-15 09:15 幸福框架 阅读(231) 评论(0) 推荐(0) 编辑

2013年11月14日

设计模式:单例模式(至少有一种你没有见过)

摘要: 背景本文中的例子多是从《clr via c#》中抄袭而来,读过这本书最后一章的朋友,应该见过各种实现了。各种实现第一种:简单版本代码 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace DesignPatternStudy.Creations.Singletons 8 { 9 class SimpleSingleton10 {11 pr... 阅读全文

posted @ 2013-11-14 14:52 幸福框架 阅读(2123) 评论(2) 推荐(4) 编辑

2013年11月13日

.NET:C# 如何实现的闭包?

摘要: 背景C# 在编译器层面为我们提供了闭包机制(Java7 和 Go 也是这种思路),本文简单的做个解释。背景知识你必须了解:引用类型、值类型、引用、对象、值类型的值(简称值)。关于引用、对象和值在内存的分配有如下几点规则:对象分配在堆中。作为字段的引用分配在堆中(内嵌在对象中)。作为局部变量(参数也是局部变量)的引用分配在栈中。作为字段的值分配在堆中(内嵌在对象中)。作为局部变量(参数也是局部变量)的值用分配在栈中。局部变量只能存活于所在的作用域(方法中的大括号确定了作用域的长短)。注:按值传递和按引用传递也是需要掌握的知识点,C# 默认是按值传递的。闭包示例测试代码 1 pri... 阅读全文

posted @ 2013-11-13 17:03 幸福框架 阅读(6800) 评论(10) 推荐(7) 编辑

2013年11月12日

.NET:CLR via C# Primitive Thread Synchronization Constructs

摘要: User-Mode ConstructsThe CLR guarantees that reads and writes to variables of the following data types are atomic: Boolean, Char, (S)Byte, (U)Int16, (U)Int32, (U)IntPtr, Single, and reference types. This means that all bytes within that variable are read from or written to all at once.Although atomic 阅读全文

posted @ 2013-11-12 08:42 幸福框架 阅读(1092) 评论(0) 推荐(0) 编辑

2013年11月11日

.NET:CLR via C# Compute-Bound Asynchronous Operations

摘要: 线程槽使用线程池了以后就不要使用线程槽了,当线程池执行完调度任务后,线程槽的数据还在。测试代码 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading; 6 using System.Threading.Tasks; 7 using System.Runtime.Remoting; 8 9 namespace ExecutionContextStudy10 {11 class Program12 ... 阅读全文

posted @ 2013-11-11 23:33 幸福框架 阅读(897) 评论(0) 推荐(0) 编辑

2013年11月10日

.NET:CLR via C#:Runtime Serialization

摘要: Making a Type SerializableThe SerializableAttribute custom attribute may be applied to reference types (class), value types (struct), enumerated types (enum), and delegate types (delegate) only. (Note that enumerated and delegate types are always serializable, so there is no need to explicitly apply 阅读全文

posted @ 2013-11-10 10:09 幸福框架 阅读(1855) 评论(0) 推荐(0) 编辑

2013年11月9日

.NET:CLR via C# Thread Basics

摘要: A thread is a Windows concept whose job is to virtualize the CPU.Thread OverheadThread kernel objectThe operating system allocates and initializes one of these data structures for each thread created in the system. The data structure contains a bunch of properties that describe the thread. This data 阅读全文

posted @ 2013-11-09 16:03 幸福框架 阅读(570) 评论(0) 推荐(0) 编辑

2013年11月8日

.NET:CLR via C#:CLR Hosting And AppDomains

摘要: AppDomain UnloadingTo unload an AppDomain, you call AppDomain’s Unload static method.This call causes the CLR to perform a lot of actions to gracefully unload the specified AppDomain:The CLR suspends all threads in the process that have ever executed managed code.The CLR examines all of the threads’ 阅读全文

posted @ 2013-11-08 10:41 幸福框架 阅读(874) 评论(0) 推荐(0) 编辑

2013年11月7日

.NET:CLR via C#The Managed Heap and Garbage Collection

摘要: Allocating Resources from the Managed HeapThe CLR requires that all objects be allocated from the managed heap. When a process is initialized, the CLR allocates a region of address space for the managed heap. The CLR also maintains a pointer, which I’ll call NextObjPtr. This pointer indicates where 阅读全文

posted @ 2013-11-07 21:05 幸福框架 阅读(539) 评论(0) 推荐(0) 编辑

2013年11月6日

.NET:CLR via C# Exceptions and State Management

摘要: 重点学习的个概念unhandled exceptionsconstrained execution regionscode contractsruntime wrapped exceptionsuncatchable exceptionsException is not related to how frequently something happensMany developers incorrectly believe that an exception is related to how frequently something happens. For example, a deve 阅读全文

posted @ 2013-11-06 08:10 幸福框架 阅读(1002) 评论(0) 推荐(0) 编辑

2013年11月5日

.NET:何时应该 “包装异常”?

摘要: 背景提到异常,我们会想到:抛出异常、异常恢复、资源清理、吞掉异常、重新抛出异常、替换异常、包装异常。本文想谈谈 “包装异常”,主要针对这个问题:何时应该 “包装异常”?“包装异常” 的技术形式包装异常是替换异常的特殊形式,具体的技术形式如下:1 try2 {3 // do something4 }5 catch (SomeException ex)6 {7 throw new WrapperException("... 阅读全文

posted @ 2013-11-05 08:59 幸福框架 阅读(1860) 评论(4) 推荐(1) 编辑

2013年11月4日

.NET:如何实现 “热插拔”?

摘要: 背景如果某个“功能”需要动态更新?这种动态更新,可能是需求驱动的,也可能是为了修改 BUG,面对这种场景,如何实现“热插拔”呢?先解释一下“热插拔”:在系统运行过程动态替换某些功能,不用重启系统进程。几种方案脚本化:采用 Iron 或 集成其它脚本引擎。AppDomain:微软的 Add In 框架就是为这个目的设计的。分布式 + 负载平衡 :轮流更新集群中的服务器。Assembly.LoadFrom + 强签名程序集:因为相同标识的程序集在内存中只会加载一次,所以每次功能发生变化,都要增加程序集的版本号。Assembly.Load + + 强签名程序集 + GAC:因为相同标识的程序集在内存 阅读全文

posted @ 2013-11-04 08:59 幸福框架 阅读(10337) 评论(13) 推荐(3) 编辑

2013年11月3日

.NET:CLR via C# Shared Assemblies and Strongly Named Assemblies

摘要: Two Kinds of Assemblies, Two Kinds of DeploymentA strongly named assembly consists of four attributes that uniquely identify the assembly: a file name (without an extension), a version number, a culture identity, and a public key. Because public keys are very large numbers, we frequently use a small 阅读全文

posted @ 2013-11-03 10:28 幸福框架 阅读(1073) 评论(0) 推荐(0) 编辑

2013年11月2日

.NET:CLR via C# Manifest

摘要: An assembly is a collection of one or more files containing type definitions and resource files. One of the assembly’s files is chosen to hold a manifest. The manifest is another set of metadata tables that basically contain the names of the files that are part of the assembly. They also describe th 阅读全文

posted @ 2013-11-02 08:47 幸福框架 阅读(717) 评论(0) 推荐(0) 编辑

2013年11月1日

.NET:CLR via C# Assembly Loading

摘要: 基础知识Internally, the CLR attempts to load this assembly by using the System.Reflection.Assembly class’s static Load method. This method is publicly documented, and you can call it to explicitly load an assembly into your AppDomain. This method is the CLR equivalent of Win32’s LoadLibrary function.Int 阅读全文

posted @ 2013-11-01 08:07 幸福框架 阅读(1003) 评论(0) 推荐(0) 编辑

2013年10月31日

.NET:鲜为人知的 “Load Context”

摘要: 背景任何一门语言都要了解其类型加载过程,如:Java 的 Class Loader,NodeJS 的搜索方式等,本文概述一下我对 CLR 如何加载程序集,重点说一下 Load Context。其编译时只是在程序集中生成了元数据(如:依赖的程序集标识)和代码。当代码执行时,CLR 会根据元数据加载依赖的程序集。Load Context参考文章:http://msdn.microsoft.com/en-us/library/dd153782(v=vs.110).aspx。Assembly 会被加载到三个 Load Context 中的任意一个,或者没有在任何上下文中,这三个 Load Contex 阅读全文

posted @ 2013-10-31 22:20 幸福框架 阅读(3128) 评论(2) 推荐(4) 编辑

2013年10月30日

.NET:CLR via C# A Brief Look at Metadata

摘要: 基础知识A managed PE file has four main parts: the PE32(+) header, the CLR header, the metadata, and the IL. The PE32(+) header is the standard information that Windows expects. The CLR header is a small block of information that is specific to modules that require the CLR (managed modules). The header 阅读全文

posted @ 2013-10-30 18:03 幸福框架 阅读(762) 评论(0) 推荐(0) 编辑

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 28 下一页

导航

我要啦免费统计