<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_Technological achievements dream_分类_VS2010</title><id>http://feed.cnblogs.com/blog/u/33262/category/244023/rss</id><updated>2012-05-27T15:28:28Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/category/244023.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/33262/category/244023/rss"/><entry><id>http://www.cnblogs.com/Henllyee/archive/2011/06/06/net_parallel_programing.html</id><title type="text">.Net 4.0 Parallel 编程之旅</title><summary type="text">在过去的时间里写了9篇Post关于.Net 4.0 Parallel 编程部分的内容，现在整理下，方便自己以后回顾阅读。 首先我们从基础的Loop开始： 1）.Net4.0 Parallel编程（一）Data Parallelism 上 2）.Net4.0 Parallel编程（二）Data Parallelism 中 3）.Net4.0 Parallel编程（三）Data Parallelism下 然后我们看看Task: 1).Net 4.0 Parallel 编程（四） Task(上) 2).Net 4.0 Parallel 编程（五）Task(中) 3).Net 4.0 ...</summary><published>2011-06-06T05:28:00Z</published><updated>2011-06-06T05:28:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2011/06/06/net_parallel_programing.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2011/06/06/net_parallel_programing.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2011/04/21/ParallelProgarmming_Nine_SharingData.html</id><title type="text">.Net 4.0 Parallel 编程（九）Task中的数据共享（下）</title><summary type="text">在上篇Post中我们看过了几种常用的同步类型，本篇文章会介绍下申明性的同步的实现以及对于集合类型数据共享的问题，首先看下申明性同步的实现。 申明性同步 我们可以通过使用Synchronization 特性来标识一个类，从而使一个类型的字段以及方法都实现同步化。在使用Synchronization 时，我们需要将我们的目标同步的类继承于System.ContextBoundObject类型。我们来看看之前的例子我们同步标识Synchronization 的实现： [Synchronization]class SumClass : ContextBoundObject{ private int _</summary><published>2011-04-21T02:17:00Z</published><updated>2011-04-21T02:17:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2011/04/21/ParallelProgarmming_Nine_SharingData.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2011/04/21/ParallelProgarmming_Nine_SharingData.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2011/04/12/ParallelProgarmming_Eight_SharingData.html</id><title type="text">.Net 4.0 Parallel编程（八）Task中的数据共享（中）</title><summary type="text">在上篇文章中我们看过了多线程中的数据共享问题，以及通过分离执行来解决的办法。本篇文章就数据共享的同步处理中的一些常见的方法进行一些介绍。 数据同步时的步骤 我之前的文章我们对数据共享问题处理的方式是“分离执行”，我们通过把每个Task执行完成后的各自计算的值进行最后的汇总，也就是说多个Task之间不存在数据共享了，各自做各自的事，完全分离开来。可是这毕竟不是我们常规的处理办法，这样我们会花更多的经历在分离上。其实我们主要的数据共享在Sum上： for (int j = 0; j &lt; 1000; j++){ Sum++;}那我们可以通过一种有序的机制来访问Sum，即当一个Task在进行Su</summary><published>2011-04-12T14:41:00Z</published><updated>2011-04-12T14:41:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2011/04/12/ParallelProgarmming_Eight_SharingData.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2011/04/12/ParallelProgarmming_Eight_SharingData.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2011/04/07/ParallelProgarmming_Seven_SharingData.html</id><title type="text">.Net 4.0 Parallel 编程（七）Task中的数据共享（上）</title><summary type="text">在前几篇文章中我们看过Parallel Loop以及Task 部分内容，而在多线程的编程中我们较为痛疼的就是多线程中的数据共享问题以及数据同步的问题。本篇Post以及后面的几篇Post中会探讨下TPL中数据共享的常见问题以及其常规的解决办法。 引例 首先我们来看下面的一段代码： static void Main(string[] args){ int Sum = 0; Task[] tasks = new Task[10]; for (int i = 0; i &lt; 10; i++) { tasks[i] = new Task(() =&gt; { for (int j = 0; j &amp;l</summary><published>2011-04-07T05:08:00Z</published><updated>2011-04-07T05:08:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2011/04/07/ParallelProgarmming_Seven_SharingData.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2011/04/07/ParallelProgarmming_Seven_SharingData.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/10/28/1863923.html</id><title type="text">.Net 4.0 Parallel 编程（五）Task(中)</title><summary type="text">在上篇文章中我们看过了如何创建Task，本篇文章就各种类型Task的使用进行说明。 Task Continuations 首先我们来看看延续的Task，所谓的延续的Task就是在第一个Task完成后自动启动下一个Task。我们通过ContinueWith方法来创建延续的Task。我们假设有一个接受xml解析的服务，首先从某个地方接受文件，然后解析入库，最后返回回执是否解析正确： 在每次调用C...</summary><published>2010-10-28T14:04:00Z</published><updated>2010-10-28T14:04:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/10/28/1863923.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/10/28/1863923.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/08/08/EntityFrameWork-CTP4-Code-First.html</id><title type="text">Entity Framework Code-First(下)</title><summary type="text">在上篇文章中看过在CTP4中Code-First的功能，这篇文章会就Code-First的自定义数据库映射、相关的Api进行一些说明。 回顾 在上篇文章中我们看到了Code-Firts带来的强大的功能。其中我们来看看前面定义的一个实体： 而之后我们需要添加一个属性，一个Remark的属性：我们再来运行下我们的测试会出现下面的错误：错误告诉我们，数据库建立了之后context已经改变了，要么手...</summary><published>2010-08-08T07:38:00Z</published><updated>2010-08-08T07:38:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/08/08/EntityFrameWork-CTP4-Code-First.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/08/08/EntityFrameWork-CTP4-Code-First.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/07/25/1784660.html</id><title type="text">Entity Framework Code-First（上）</title><summary type="text">在7.14号微软ado.net团队发布了EF Feature CTP4，在ctp4中code-first得到了很大的加强，支持了很多属性。本篇文章中就code-first进行一些尝试。 准备 1.下载ctp4：Entity Framework Feature CTP4. 2.准备我们的工程： 各个项目之间的关系以及作用就不必多说了。 创建Model 我们建立一个employee、depa...</summary><published>2010-07-25T06:42:00Z</published><updated>2010-07-25T06:42:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/07/25/1784660.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/07/25/1784660.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/07/23/EntityFramewrok_POCO_T4Template.html</id><title type="text">Entity Framework POCO T4模板使用</title><summary type="text">在之前的文章中写过Entity Framework中POCO的支持。其实在VS2010的Extension里面提供了POCO的模板给我们了，我们可以很快地来实现Entity 跟Contenx的生成了。本文中将介绍POCO模板的使用。 安装 我们选择C#POCO Entity Generator，下载之后，在弹出的对话框中选择安装即可。 生成代码 在这里我们使用Northwind数据库，首先先...</summary><published>2010-07-23T14:41:00Z</published><updated>2010-07-23T14:41:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/07/23/EntityFramewrok_POCO_T4Template.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/07/23/EntityFramewrok_POCO_T4Template.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/07/11/1775302.html</id><title type="text">.Net 4.0 DynamicObject使用（下）</title><summary type="text">在上篇文章中我们看过了DynamicObject的基本使用，这篇文章中我们通过Dynamic来实现一个操作xml的动态类型，让我们更为方便的操作xml。 其实在前面的使用ExpandoObject的文章中我们已经，通过ExpandoObject来实现了操作Xml，并体现了动态性，但是不好的是，里面没有Linq to Xml大量Api的支持，操作起来很不方便，同时我们需要编写大量的辅助方法才行。而...</summary><published>2010-07-11T10:44:00Z</published><updated>2010-07-11T10:44:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/07/11/1775302.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/07/11/1775302.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/07/05/DynamicObject1.html</id><title type="text">.Net4.0 DynamicObject的使用（上）</title><summary type="text">在上两篇文章中我们已经介绍了使用ExpandoObject进行动态编程，同时也使用了ExpandoObject操作xml。本片文章就说下DynamicObject的基本使用。 概述 DynamicObject跟ExpandoObject最大的区别就是，我们可以通过继承DynamicObject，自己来决定动态对象如何执行。我们先来看下DynamicObject的定义中初始化函数： &amp;#160...</summary><published>2010-07-05T14:05:00Z</published><updated>2010-07-05T14:05:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/07/05/DynamicObject1.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/07/05/DynamicObject1.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/06/22/ExpandoObject2.html</id><title type="text">.Net 4.o ExpandoObject 使用（下）</title><summary type="text">在上篇文章介绍了ExpandoObject的基本使用，本篇文章就ExpandoObject的一些高级的使用进行一些示例。 例子 首先要说的一点，为什么我们在定义动态类型的ExpandoObject时，必须要使用dynamic关键字呢，因为如果我们使用ExpandoObject 进行定义时，那么我们定义的变量就是一个静态类型ExpandoObject的实例化。 下面我们来做个例子就是如何将xm...</summary><published>2010-06-22T14:29:00Z</published><updated>2010-06-22T14:29:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/06/22/ExpandoObject2.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/06/22/ExpandoObject2.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/06/20/ExpandoObject1.html</id><title type="text">.Net 4.0 ExpandoObject 使用（上）</title><summary type="text">本篇文章中就ExpandoObject的基本使用进行一些demo。我们几乎都知道dynamic特性是.net 4.0中一个主要的新特性，而ExpandoObject正是这样的一个动态的类型。ExpandoObject允许我们在实例化之后在运行时进行成员的增加、删除。下面我们来看下基本的使用： Adding Members 1)实例化 如果需要延迟绑定的话，我们需要用dynamic来定义Exp...</summary><published>2010-06-20T02:59:00Z</published><updated>2010-06-20T02:59:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/06/20/ExpandoObject1.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/06/20/ExpandoObject1.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/06/14/ParallelProgaramming3.html</id><title type="text">.Net4.0 Parallel编程（三）Data Parallelism下</title><summary type="text">在上篇文章中介绍了如何Break、Stop循环，以及如何定义线程局部变量。在本文中介绍如何在外部去取消循环、以及异常的处理。 Cancel 在并行的循环中支持通过传递ParallelOptions参数中的CancellationToken进行取消循环的控制，我们可以CancellationTokenSource实例化之后传递给ParallelOptions对象Cancellation值。下面来...</summary><published>2010-06-14T11:31:00Z</published><updated>2010-06-14T11:31:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/06/14/ParallelProgaramming3.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/06/14/ParallelProgaramming3.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/06/09/ParallelProgaramming2.html</id><title type="text">.Net4.0 Parallel编程（二）Data Parallelism 中</title><summary type="text">在上篇文章中看过了使用Parrallel.For、Parael.Foreach在效率上给我们带来的提高。本文就来如何终止循环、线程局部变量 进行说明。 Thread-Local Variables 首先我们来看下线程局部变量，是的我们也许一直在想我们如何去定义一个线程局部变量呢。先看段顺序执行的代码： 执行结果： 我们再来看这段代码：执行结果： 再运行下： 也许我们会感到很奇怪为什么会这样呢...</summary><published>2010-06-09T13:58:00Z</published><updated>2010-06-09T13:58:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/06/09/ParallelProgaramming2.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/06/09/ParallelProgaramming2.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/05/01/ParallelProgaramming1.html</id><title type="text">.Net4.0 Parallel编程（一）Data Parallelism 上</title><summary type="text">现在已经进入了多核的时代，我们的程序如何更多的利用好cpu，答案是并行处理。在.net4.0之前我们要开发并行的程序是非常的困难，在.net4.0中，在命名空间System.Threading.Tasks提供了方便的并行开发的类库。本文中主要看看Data Parallel， 看看并行的For、Foreach。 Parallel.For 首先先写一个普通的循环： 再看一个并行的For语句：看...</summary><published>2010-05-01T08:42:00Z</published><updated>2010-05-01T08:42:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/05/01/ParallelProgaramming1.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/05/01/ParallelProgaramming1.html"/><content type="text">现在已经进入了多核的时代，我们的程序如何更多的利用好cpu，答案是并行处理。在.net4.0之前我们要开发并行的程序是非常的困难，在.net4.0中，在命名空间System.Threading.Tasks提供了方便的并行开发的类库。本文中主要看看Data Parallel， 看看并行的For、Foreach。 Parallel.For 首先先写一个普通的循环： 再看一个并行的For语句：看...</content></entry><entry><id>http://www.cnblogs.com/Henllyee/archive/2010/04/15/1713107.html</id><title type="text">VS2010 Tips(一)  LayerDiagram</title><summary type="text">VS2010已经正式发布，最近一直在尝试里面的一些新的工具以及结合TFS的一些使用，本篇文章中使用了下分层图。 准备 首先我在建立了一个项目叫：Entity4Demo.Access项目是用Entity FrameWork做的一个数据访问层，然后建立了一个Test项目，结构图如下： 在以前如果项目很多的时候，我们很难去辨别我们的各个Project有没有按照我们当初的层次结构去开发，而在VS2010里...</summary><published>2010-04-15T15:46:00Z</published><updated>2010-04-15T15:46:00Z</updated><author><name>Henry Cui</name><uri>http://www.cnblogs.com/Henllyee/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Henllyee/archive/2010/04/15/1713107.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Henllyee/archive/2010/04/15/1713107.html"/><content type="text">VS2010已经正式发布，最近一直在尝试里面的一些新的工具以及结合TFS的一些使用，本篇文章中使用了下分层图。 准备 首先我在建立了一个项目叫：Entity4Demo.Access项目是用Entity FrameWork做的一个数据访问层，然后建立了一个Test项目，结构图如下： 在以前如果项目很多的时候，我们很难去辨别我们的各个Project有没有按照我们当初的层次结构去开发，而在VS2010里...</content></entry></feed>
