上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 36 下一页
摘要: 异步IO、APC、IO完成端口、线程池与高性能服务器之二 APC     Alertable IO(告警IO)提供了更有效的异步通知形式。ReadFileEx / WriteFileEx在发出IO请求的同时,提供一个回调函数(APC过程),当IO请求完成后,一旦线程进入可告警状态,回调函数将会执行。     以下五个函数能够使线程进入告警... 阅读全文
posted @ 2010-01-29 01:02 Fan Zhang 阅读(386) 评论(0) 推荐(0)
摘要: Types of APCsAn asynchronous procedure call (APC) is a function that executes asynchronously. APCs are similar to deferred procedure calls (DPCs), but unlike DPCs, APCs execute within the context of a... 阅读全文
posted @ 2010-01-28 20:49 Fan Zhang 阅读(212) 评论(0) 推荐(0)
摘要: IoGetDeviceProperty 阅读全文
posted @ 2010-01-28 18:06 Fan Zhang 阅读(249) 评论(0) 推荐(0)
摘要: synchronized机制ReentrantLock 都类似于mutex,一个线程如果获取了一次mutex,可以再次获取第二次mutex,而不被阻塞。 ReentrantLock提供了更富在的操作,包括可以被中断(lockInterruptibly函数)。   sleep()、yield()、wait() sleep()、yield()不会释放lock wait()会释放loc... 阅读全文
posted @ 2010-01-26 11:36 Fan Zhang 阅读(138) 评论(0) 推荐(0)
摘要: primitive types不需要用new,而且是传值而非引用。 int a = 0; long b = 0L; float c = 0f; double d = 0d; 阅读全文
posted @ 2009-12-23 16:37 Fan Zhang 阅读(145) 评论(0) 推荐(0)
摘要: Your new class can be made up of any number and type of other objects, in any combination that you need to achieve the functionality desired in your new class. Because you are composing a new class fr... 阅读全文
posted @ 2009-12-23 14:28 Fan Zhang 阅读(370) 评论(0) 推荐(0)
摘要: 尽量采用List和HashMap,rather than Vector&Hashtable.   Vector是有信号量的,可以同步锁,ArrayList没有,所以相对来说ArrayList的存取速度比Vector快。 同理HashMap比Hashtable快 阅读全文
posted @ 2009-12-23 01:01 Fan Zhang 阅读(134) 评论(0) 推荐(0)
摘要: Queue<String> myQueue = new LinkedList<String>(); myQueue.add("A"); myQueue.add("B"); myQueue.add("C"); myQueue.add("D"); List<String> myList ... 阅读全文
posted @ 2009-12-23 00:55 Fan Zhang 阅读(158) 评论(0) 推荐(0)
摘要: import java.util.ArrayList; import java.util.List; public class MainClass { public static void main(String[] args) { List stringList1 = new ArrayList(); stringList1.add("Java 5"); stringList... 阅读全文
posted @ 2009-12-23 00:38 Fan Zhang 阅读(138) 评论(0) 推荐(0)
摘要: stream是针对byte[]操作,针对于二进制文件操作。 Reader和Writer针对char操作,针对于文本文件操作。默认是用本机的编码方式写char ,如UTF-8和UTF-16和GB2312编码 Reader和Writer是abstract类,不能直接用,一般用FileReader和FileWriter。 如果采用具体编码,需要采用OutputStreamWriter。注意Output... 阅读全文
posted @ 2009-12-22 18:14 Fan Zhang 阅读(280) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 36 下一页