Core Java
YiYiDog125
这个作者很懒,什么都没留下…
展开
-
Compare ArrayList and LinkedList
[list] I'd better write down something before I forget 1. LinkedList is doubly linked, so it takes up more space and cannot hold as many elements as ArrayList. 2. Insertion, ArrayList is faster, in...2010-10-18 12:25:56 · 151 阅读 · 0 评论 -
Java Semaphore
Java introduced Semaphore since 1.5, let's see how we can use it to maintain an order for thread access. Suppose we have the following code: class Foo { public: A(.....); B(.....); } Foo f; ...2010-10-18 12:34:35 · 91 阅读 · 0 评论 -
转一篇多线程的atomicity, visibility and orderding
[url] http://jeremymanson.blogspot.com/2007/08/atomicity-visibility-and-ordering.html [/url] 另外一篇讲volatile的也值得读 [url]http://jeremymanson.blogspot.com/2007/08/volatile-does-not-mean-atomic.html[/...原创 2010-10-22 13:40:27 · 141 阅读 · 0 评论 -
Several approaches to solve deadlock
This is an example from the official concurrency tutorial. [url]http://download.oracle.com/javase/tutorial/essential/concurrency/deadlock.html[/url] The reason for the deadlock here is that there...2010-11-10 03:10:20 · 143 阅读 · 0 评论 -
Swing Timer
Lab mate came by and talked about a feature he needs to update several textfield periodically on a panel. He is monitoring some resources and will generate a file for display every second, so his UI o...2010-11-10 03:20:05 · 126 阅读 · 0 评论 -
File Locks
Some scenarios on Windows 1. using a notepad to edit a txt file, at the same time, a java program is using BufferedReader to read it, what it read is the stale content. 2. when a lock is grabbed, tr...2010-11-13 14:11:30 · 287 阅读 · 0 评论 -
<T extends Comparable<? super T>>
2010-11-13 15:49:41 · 183 阅读 · 0 评论