ITeye博客

willpower

willpower · 共 68 篇文章

A simple thread pool implementation

java 代码 import java.util.Vector; /** * Thread pool */ public class ThreadPool implements Runnable { // Default ThreadPool minimum size public final static int DEFAULT_MIN_SIZE = 0; // Default ThreadPool maximum size public final static int DEFAULT_MAX_SIZE = Integer.MAX_VALUE; public final static l…

2007-03-07 11:53 · Study 学习 · 评论(0)

A useful MultiSemaphore

java 代码 public class MultiSemaphore { protected int value; public MultiSemaphore(int v) { value = v; } //The P method here takes an integer parameter of how many instances of the //semaphore lock have been requested. The method will block until all //instances are available. public synchronized voi…

2007-03-07 11:50 · Study 学习 · 评论(1)

多线程同步与互斥

和作者联系: djb_skyface@tom.com 接触多线程已经不少时间了,也做了不少事情,但是一直觉得用起来不那么顺手,在debug的时候,往往会比较担心在同步上出什么问题,想起"程序员最怕的是自己写的代码"这句话,觉得真是不假. 终于有一天,我觉得是时候把这个问题弄清楚了,所以,我就在网上找相关的内容看,结果竟然是找不到在我这个阶段应该看的,不是太简单,就是一笔带过,不知所云. 废了九牛二虎之力,终于差不多弄清楚了,其中有不少误区,以前认为的和真理相差甚大.想起自己花费的时间,真是觉得有点多,所以把它写出来,一是防止自己以后又会忘掉,二是给像我一样的似懂非懂者留下一点可以参考的东东.…

2007-03-07 11:44 · Study 学习 · 评论(0)

Linux Basics - 2

1>man(help), passwd(change password), su - root(switch user), who(who is logged in), date(date and time), echo(disply message) echo $PATH /usr/bin:/usr/local/bin echo My name is $USER - Home directory=$HOME. My name is hermie - Home directory=/home/hermie. The echo command is very similar to the DO…

2007-03-06 15:58 · Study 学习 · 评论(0)

Linux Basics - 1

1> linux file types: ordinary, directory, block(harddisk...device), character(crt,...) 2> file name: 256 characters 3> directories: /bin Contains the Linux system commands and programs (also called binaries). Pronounced "slash bin." /dev Contains special device files that correspond to hardware com…

2007-03-06 14:25 · Study 学习 · 评论(0)

Funny story

This is the first time: java 代码 System.out.println("Q: 陈英俊先生, 你对三配小姐有什么看法?"); System.out.println("A: 什么啊? 国里有三配啊? 我握是不晓得罗"); System.out.println("News: 陈英俊一下飞机就开始寻找三配小姐"); The second time: java 代码 System.out.println("Q: 陈英俊先生, 你对三配小姐有什么看法?"); System.out.println("陈英俊没有回答"); System.out.println("News: …

2007-03-06 11:23 · Others 杂文 · 评论(0)

自我介绍

java 代码 System.out.println("What's ur name?"); System.out.println("My name is willpower"); 将这段代码献给所有路过的朋友... Cheers.

2007-03-05 15:23 · Others 杂文 · 评论(1)

终于有了自己的第一个中文博客

热烈祝贺我的第一个中文博客开张. Congratulations!!!

2007-03-05 09:51 · Others 杂文 · 评论(0)