asmallbird.blogspot.com
我是一只小小鸟: 多线程环境下的Observer pattern
http://asmallbird.blogspot.com/2007/06/observer-pattern.html
Share sth with you.It includes kinds of programming languages(Java,C,C ,Ruby,Haskell,Scala,etc.),a set of intersting algorithms,information retrieval technology. 星期日, 六月 03, 2007. 在“The Problem with Threads"论文中提到的用来抨击线程模型的实例。懒得说了,看代码直接:. Private List listeners = new LinkedList();. Private int value;. Public void valueChanged(int newValue);. Public void addListener(Listener listener){. Public void setValue(int newValue){. Value = newValue;. Iterator i = copyOfListeners.iterator();. Private int value;.
asmallbird.blogspot.com
我是一只小小鸟: Green Thread不比Native Thread差
http://asmallbird.blogspot.com/2007/05/green-threadnative-thread.html
Share sth with you.It includes kinds of programming languages(Java,C,C ,Ruby,Haskell,Scala,etc.),a set of intersting algorithms,information retrieval technology. 星期四, 五月 31, 2007. 在Ruby实现中,Ruby1.8采用的是Green thread,JRuby和XRuby采用的是Native thread,Rubinius既支持Green thread,也支持Native thread。Ruby1.9将由Green thread转向Native thread。Green thread有哪些不足呢? 在“ Ruby Userspace Threads vs GUI tookits Roundup. 看来XRuby的thread实现可以好好借鉴一下Erlang的并发范式。在看了“ The Futures of Ruby Threading. 8221;之后,更坚定了应该朝这方面努力。 订阅: 帖子评论 (Atom).
asmallbird.blogspot.com
我是一只小小鸟: 05/01/2007 - 06/01/2007
http://asmallbird.blogspot.com/2007_05_01_archive.html
Share sth with you.It includes kinds of programming languages(Java,C,C ,Ruby,Haskell,Scala,etc.),a set of intersting algorithms,information retrieval technology. 星期四, 五月 31, 2007. 在Ruby实现中,Ruby1.8采用的是Green thread,JRuby和XRuby采用的是Native thread,Rubinius既支持Green thread,也支持Native thread。Ruby1.9将由Green thread转向Native thread。Green thread有哪些不足呢? 在“ Ruby Userspace Threads vs GUI tookits Roundup. 看来XRuby的thread实现可以好好借鉴一下Erlang的并发范式。在看了“ The Futures of Ruby Threading. 8221;之后,更坚定了应该朝这方面努力。 星期三, 五月 30, 2007. 此时虽然缓存能...
asmallbird.blogspot.com
我是一只小小鸟: 10/01/2006 - 11/01/2006
http://asmallbird.blogspot.com/2006_10_01_archive.html
Share sth with you.It includes kinds of programming languages(Java,C,C ,Ruby,Haskell,Scala,etc.),a set of intersting algorithms,information retrieval technology. 星期三, 十月 25, 2006. 基本算法连载(14)-BST(Binary Search Tree)的笔记. 插入实现(传指针地址的地址):. Void InsertNode(struct node * node ptr, struct node *newNode) {. Struct node *node = *node ptr;. If (node = NULL). Node ptr = newNode;. Else if (newNode- value = node- value). InsertNode(&node- left, newNode);. InsertNode(&node- right, newNode);. If (node- left = NULL) {.
asmallbird.blogspot.com
我是一只小小鸟: 09/01/2006 - 10/01/2006
http://asmallbird.blogspot.com/2006_09_01_archive.html
Share sth with you.It includes kinds of programming languages(Java,C,C ,Ruby,Haskell,Scala,etc.),a set of intersting algorithms,information retrieval technology. 星期四, 九月 21, 2006. 基本算法连载(8)-Library Sort(gapped insertion sort). 65306;Library sort优于传统的插入排序(时间复杂度为O(n 2) ,它的时间复杂度为O(nlogn),采用了空间换时间的策略。 65306;一个图书管理员需要按照字母顺序放置书本,当在书本之间留有一定空隙时,一本新书上架将无需移动随后的书本,可以直接插空隙。Library sort的思想就源于此。 Void librarySort(int length,float factor,int elements[]){. Int expandedLen = (int)( 1 factor)*length);. Int flag = 1 31;.
asmallbird.blogspot.com
我是一只小小鸟: Thread的层次结构
http://asmallbird.blogspot.com/2007/06/thread_02.html
Share sth with you.It includes kinds of programming languages(Java,C,C ,Ruby,Haskell,Scala,etc.),a set of intersting algorithms,information retrieval technology. 星期六, 六月 02, 2007. 常说Java线程是Native thread,是说Java的一个线程映射到操作系统上的一个用户线程。往下随后怎么映射就要看操作系统的实现了。可以看看 Solaris的线程模型. 不过Java线程也并不一定是一一映射的,比如Jikes RVM虚拟机,采用了M:N模型,而不是大家经常看到的1:1,具体资料可以看 这里. 12290;BEA的JRockit是两个都有,既支持1:1模型,也支持M:N模型,叫Thin Thread。 订阅: 帖子评论 (Atom). I'm a programmer and very intersted in kinds of magic technology filled with challenge.
asmallbird.blogspot.com
我是一只小小鸟: 有了OpenMP,MPI,为什么还要MapReduce?
http://asmallbird.blogspot.com/2007/05/openmpmpimapreduce.html
Share sth with you.It includes kinds of programming languages(Java,C,C ,Ruby,Haskell,Scala,etc.),a set of intersting algorithms,information retrieval technology. 星期三, 五月 30, 2007. 有了OpenMP,MPI,为什么还要MapReduce? OpenMP:线程级(并行粒度);共享存储;隐式(数据分配方式);可扩展性差;. MPI:进程级;分布式存储;显式;可扩展性好。 OpenMP采用共享存储,意味着它只适应于SMP,DSM机器,不适合于集群。MPI虽适合于各种机器,但它的编程模型复杂:. MPI程序可靠性差,一个进程出问题,整个程序将错误;. 其中第2个问题感受深刻。每次听我们部门并行组的人做报告,总是听到他们在攻克通信延迟大和负载不平衡的问题。一种并行算法的好坏就看它有没有很好的解决这两个问题。 与OpenMP,MPI相比,MapReduce的优势何在呢? 订阅: 帖子评论 (Atom).
asmallbird.blogspot.com
我是一只小小鸟: 06/01/2007 - 07/01/2007
http://asmallbird.blogspot.com/2007_06_01_archive.html
Share sth with you.It includes kinds of programming languages(Java,C,C ,Ruby,Haskell,Scala,etc.),a set of intersting algorithms,information retrieval technology. 星期日, 六月 03, 2007. 在“The Problem with Threads"论文中提到的用来抨击线程模型的实例。懒得说了,看代码直接:. Private List listeners = new LinkedList();. Private int value;. Public void valueChanged(int newValue);. Public void addListener(Listener listener){. Public void setValue(int newValue){. Value = newValue;. Iterator i = copyOfListeners.iterator();. Private int value;.
asmallbird.blogspot.com
我是一只小小鸟: 多核意味着什么?
http://asmallbird.blogspot.com/2007/05/blog-post_30.html
Share sth with you.It includes kinds of programming languages(Java,C,C ,Ruby,Haskell,Scala,etc.),a set of intersting algorithms,information retrieval technology. 星期三, 五月 30, 2007. 此时用户程序无须修改,就可以获得CPU性能提升所带来的好处。现在,提升CPU性能的方法:. 此时虽然缓存能,但超线程和多核CPU对现在的绝大多数应用,几乎不会有任何影响。多核还说不定会降慢程序的运行,因为多核带来的是更强的并行处理能力、更高的计算密度和更低的时钟频率。如果不采用并发好好利用硬件资源,多核CPU真的是浪费。 订阅: 帖子评论 (Atom). 有了OpenMP,MPI,为什么还要MapReduce? I'm a programmer and very intersted in kinds of magic technology filled with challenge.