<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_hbfly's space</title><subtitle type="text">SDET-变化的不是需求，而是你对需求的理解</subtitle><id>http://feed.cnblogs.com/blog/u/20164/rss</id><updated>2011-04-26T06:29:29Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/20164/rss"/><entry><id>http://www.cnblogs.com/hbreset/archive/2011/04/26/2029296.html</id><title type="text">基础知识</title><summary type="text">线程同步的方式和机制临界区、互斥区、事件、信号量四种方式临界区（Critical Section）、互斥量（Mutex）、信号量（Semaphore）、事件（Event）的区别 1、临界区：通过对多线程的串行化来访问公共资源或一段代码，速度快，适合控制数据访问。在任意时刻只允许一个线程对共享资源进行访问，如果有多个线程试图访问公共资源，那么在有一个线程进入后，其他试图访问公共资源的线程将被挂起，并一直等到进入临界区的线程离开，临界区在被释放后，其他线程才可以抢占。 2、互斥量：采用互斥对象机制。 只有拥有互斥对象的线程才有访问公共资源的权限，因为互斥对象只有一个，所以能保证公共资源不会同时被多</summary><published>2011-04-26T06:29:00Z</published><updated>2011-04-26T06:29:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2011/04/26/2029296.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2011/04/26/2029296.html"/><content type="html">&lt;p&gt;线程同步的方式和机制&lt;br /&gt;&lt;br /&gt;临界区、互斥区、事件、信号量四种方式&lt;br /&gt;临界区（Critical Section）、互斥量（Mutex）、信号量（Semaphore）、事件（Event）的区别 &lt;br /&gt;1、临界区：通过对多线程的串行化来访问公共资源或一段代码，速度快，适合控制数据访问。在任意时刻只允许一个线程对共享资源进行访问，如果有多个线程试图访问公共资源，那么在有一个线程进入后，其他试图访问公共资源的线程将被挂起，并一直等到进入临界区的线程离开，临界区在被释放后，其他线程才可以抢占。 &lt;br /&gt;2、互斥量：采用互斥对象机制。 只有拥有互斥对象的线程才有访问公共资源的权限，因为互斥对象只有一个，所以能保证公共资源不会同时被多个线程访问。互斥不仅能实现同一应用程序的公共资源安全共享，还能实现不同应用程序的公共资源安全共享 &lt;br /&gt;3、信号量：它允许多个线程在同一时刻访问同一资源，但是需要限制在同一时刻访问此资源的最大线程数目 &lt;br /&gt;4、事 件： 通过通知操作的方式来保持线程的同步，还可以方便实现对多个线程的优先级比较的操作&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;区别：工厂方法模式只有一个抽象产品类，而抽象工厂模式有多个。&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 工厂方法模式的具体工厂类只能创建一个具体产品类的实例，而抽象工厂模式可以创建多个。&lt;br /&gt;－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1.如果一个后花园只种蔬菜类,那么就用简单工厂就可以了.&lt;br /&gt;&amp;nbsp;&amp;nbsp; 2.如果后花园蔬菜品种繁多.得用工厂方法才可以,把共有的东西抽象出来.&lt;br /&gt;&amp;nbsp;&amp;nbsp; 3.如果要扩大后花园的规模,比如一个在北方,一个在南方,这样工厂方法就无法实现了,就应当用抽象工厂,把各种各样的植物,又组成一个后花园.&lt;br /&gt;所以我个人认为,简单工厂是一个工厂只生产一类的产品,面对的是具体的类,工厂方法是可以生产不同的产品,把公共的方法抽象出来,然后进行创建各种各样的产品.抽象工厂把几种产品划出共同的东西,把相互依赖的对象抽象出来,只要实现这些接口就可以得到不同的产品.&lt;br /&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/hbreset/aggbug/2029296.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/hbreset/archive/2011/04/26/2029296.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/hbreset/archive/2010/10/25/1860432.html</id><title type="text">工作过程中的经验</title><summary type="text">1）写一个比较复杂的文本处理工具，不要妄图代码可以处理所有情况，一定要一种ruler.txt的机制，里面有对应的 a强制替换成 b， 甚至还要有加载特定的ruler.txt的机制2）</summary><published>2010-10-25T07:06:00Z</published><updated>2010-10-25T07:06:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2010/10/25/1860432.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2010/10/25/1860432.html"/><content type="html">&lt;p&gt;1）写一个比较复杂的文本处理工具，不要妄图代码可以处理所有情况，一定要一种ruler.txt的机制，里面有对应的 a强制替换成 b， 甚至还要有加载特定的ruler.txt的机制&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;2）&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/hbreset/aggbug/1860432.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/hbreset/archive/2010/10/25/1860432.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/hbreset/archive/2009/04/28/1445738.html</id><title type="text">用C#创建各种类型的wave文件</title><summary type="text">最近的工作用到创建wave文件，把方法share出来现在只是能work但还有很大的缺陷1）正确的写入方法是开辟一块buffer，然后一个线程写入，一个读。或者用stream但没弄出来开，着急赶工就采用了逐秒写入这种笨方法，考虑过用内存映射文件，也卡住了，等明天贴上[代码]</summary><published>2009-04-28T15:00:00Z</published><updated>2009-04-28T15:00:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2009/04/28/1445738.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2009/04/28/1445738.html"/></entry><entry><id>http://www.cnblogs.com/hbreset/archive/2009/02/03/1383227.html</id><title type="text">中国的十二生肖原来还代表着对人品格的要求</title><summary type="text">中国人说:第一组是老鼠和牛.老鼠代表智慧,牛代表勤奋.智慧和勤奋一定要紧紧结合在一起.如果光有智慧,不勤奋,那就变成小聪明;而光是勤奋,不动脑筋,那就变成愚蠢.这两者一定要结合.这是祖先对我们第一组的期望和要求,也是最重要的一组. 第二组是老虎和兔子.老虎代表勇猛,兔子代表谨慎.勇猛和谨慎一定要紧紧结合在一起才能作到胆大心细.如果勇猛离开了谨慎,就变成了鲁莽,而没了勇猛,就变成了胆怯.这一组也非常...</summary><published>2009-02-03T07:34:00Z</published><updated>2009-02-03T07:34:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2009/02/03/1383227.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2009/02/03/1383227.html"/></entry><entry><id>http://www.cnblogs.com/hbreset/archive/2008/12/02/1345887.html</id><title type="text">学习OO思想</title><summary type="text">没抓住主线，请指教。[代码]</summary><published>2008-12-02T07:01:00Z</published><updated>2008-12-02T07:01:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2008/12/02/1345887.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2008/12/02/1345887.html"/></entry><entry><id>http://www.cnblogs.com/hbreset/archive/2008/10/14/1310610.html</id><title type="text">朋友由一道面试题想到的递归的解决办法</title><summary type="text">原题：用递归求第10个数，它等于前2数之和，如{1，1，2，3，5}[代码]</summary><published>2008-10-14T03:09:00Z</published><updated>2008-10-14T03:09:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2008/10/14/1310610.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2008/10/14/1310610.html"/></entry><entry><id>http://www.cnblogs.com/hbreset/archive/2008/09/11/1289351.html</id><title type="text">最精简SQL教程，查漏补疑</title><summary type="text">[代码]</summary><published>2008-09-11T09:33:00Z</published><updated>2008-09-11T09:33:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2008/09/11/1289351.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2008/09/11/1289351.html"/></entry><entry><id>http://www.cnblogs.com/hbreset/archive/2008/08/29/1279313.html</id><title type="text">nunit的最精简教程</title><summary type="text">可能要用到。[代码]</summary><published>2008-08-29T03:38:00Z</published><updated>2008-08-29T03:38:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2008/08/29/1279313.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2008/08/29/1279313.html"/></entry><entry><id>http://www.cnblogs.com/hbreset/archive/2008/08/07/1263126.html</id><title type="text">为什么收入越来越少？你所不注意的26%的社保税</title><summary type="text">最近大家的工资到手，人人都吃了一惊，怎么发到手里的钱比以前还少了呢？前段时间公司大张旗鼓的给每个人涨了工资，个人所得税得起征点也提高了，怎么钱越来越少了呢？要弄明白这里面的道道，得仔细研究我们的工资条。　　　　事实上，国/家真正从个人收走的钱，个人所得税制是一个小头，真正的大头是各类以保障民生为名义的社保。而这些社保里面，个人缴纳的又是小部分，真正的大头在于单位缴纳的那部分。以下是上海市的规定的社...</summary><published>2008-08-07T09:27:00Z</published><updated>2008-08-07T09:27:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2008/08/07/1263126.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2008/08/07/1263126.html"/></entry><entry><id>http://www.cnblogs.com/hbreset/archive/2008/08/07/1263042.html</id><title type="text">反射</title><summary type="text">反射的性能： 使用反射来调用类型或者触发方法，或者访问一个字段或者属性时clr 需 要做更多的工作：校验参数，检查权限等等，所以速度是非常慢的。所以尽量不要使用反射进行编程，对于打算编写一个动态构造类型（晚绑定）的应用程序，可以采取以下的几种方式进行代替： 1． 通过类的继承关系。让该类型从一个编译时可知的基础类型派生出来，在运行时生成该类 型的一个实例，将对其的引用放到其基础类型的一个变量中，然...</summary><published>2008-08-07T07:56:00Z</published><updated>2008-08-07T07:56:00Z</updated><author><name>hbfly</name><uri>http://www.cnblogs.com/hbreset/</uri></author><link rel="alternate" href="http://www.cnblogs.com/hbreset/archive/2008/08/07/1263042.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/hbreset/archive/2008/08/07/1263042.html"/></entry></feed>
