08 2013 档案

摘要:ExecutorsIn all of the previous examples, there's a close connection between the task being done by a new thread, as defined by itsRunnableobject, and the thread itself, as defined by aThreadobject. This works well for small applications, but in large-scale applications, it makes sense to separa 阅读全文
posted @ 2013-08-31 21:08 alexander.bruce.lee 阅读(1288) 评论(0) 推荐(0)
摘要:Lock ObjectsSynchronized code relies on a simple kind of reentrant lock. This kind of lock is easy to use, but has many limitations. More sophisticated locking idioms are supported by thejava.util.concurrent.lockspackage. We won't examine this package in detail, but instead will focus on its mos 阅读全文
posted @ 2013-08-27 23:43 alexander.bruce.lee 阅读(850) 评论(0) 推荐(0)
摘要:High Level Concurrency ObjectsSo far, this lesson has focused on the low-level APIs that have been part of the Java platform from the very beginning. These APIs are adequate for very basic tasks, but higher-level building blocks are needed for more advanced tasks. This is especially true for massive 阅读全文
posted @ 2013-08-27 00:48 alexander.bruce.lee 阅读(1033) 评论(0) 推荐(0)
摘要:A Strategy for Defining Immutable ObjectsThe following rules define a simple strategy for creating immutable objects. Not all classes documented as "immutable" follow these rules. This does not necessarily mean the creators of these classes were sloppy — they may have good reason for belie 阅读全文
posted @ 2013-08-26 01:08 alexander.bruce.lee 阅读(1022) 评论(0) 推荐(0)
摘要:Immutable ObjectsAn object is consideredimmutableif its state cannot change after it is constructed. Maximum reliance on immutable objects is widely accepted as a sound strategy for creating simple, reliable code.Immutable objects are particularly useful in concurrent applications. Since they cannot 阅读全文
posted @ 2013-08-19 01:18 alexander.bruce.lee 阅读(866) 评论(0) 推荐(0)
摘要:2013-08-1323:32:30乘情人节还没有过去,作为一个屌丝程序员,从来没有过过情人节。不过我们也有自己的乐趣,这个时候貌似只有海子的《面朝大海》能够啊Q式慰藉自己。不多说了,早上上班的时候看到google首页,就感觉很有爱,不过当时没怎么玩,只是点点了,听听背景音乐,感觉甚好。话说作为程序员,看看国内某著名搜索引擎的情况就显得捉襟见肘了。咱没鄙视它的权利,没准它还会鄙视我等屌丝程序员,有zf支持,能赚钱才是硬道理啊!作为屌丝程序员还是先玩玩谷歌的小游戏,不为搜索,只想玩玩,呵呵,谁叫咱单身屌丝。上传几张图片,祝福哪些牛郎、织女们!!!firstsecondthird.作为成员员,怎么 阅读全文
posted @ 2013-08-13 23:52 alexander.bruce.lee 阅读(1701) 评论(7) 推荐(0)
摘要:Guarded BlocksThreads often have to coordinate their actions. The most common coordination idiom is theguarded block. Such a block begins by polling a condition that must be true before the block can proceed. There are a number of steps to follow in order to do this correctly.Suppose, for examplegua 阅读全文
posted @ 2013-08-06 00:05 alexander.bruce.lee 阅读(817) 评论(0) 推荐(0)
摘要:Starvation and LivelockStarvation and livelock are much less common a problem than deadlock, but are still problems that every designer of concurrent software is likely to encounter.StarvationStarvationdescribes a situation where a thread is unable to gain regular access to shared resources and is u 阅读全文
posted @ 2013-08-03 23:19 alexander.bruce.lee 阅读(1314) 评论(0) 推荐(0)
摘要:A concurrent application's ability to execute in a timely manner is known as itsliveness. This section describes the most common kind of liveness problem,deadlock, and goes on to briefly describe two other liveness problems,starvation and livelock.译文: 一个并发应用程序在时间上的执行的能力被称为活动性。这一节主要描述了活动性的问题,死锁,并 阅读全文
posted @ 2013-08-01 22:32 alexander.bruce.lee 阅读(394) 评论(0) 推荐(0)