- 博客(7)
- 资源 (10)
- 收藏
- 关注
原创 Jetty:配置概览-怎么配置Jetty
Jetty POJO配置Jetty的核心组件是Plain Old Java Objects(POJOs);配置Jetty的大部分工作就是在Jetty POJOs上的初始化、装配和设置域的处理,你能通过下面的方式来实现: 1)直接通过Java代码初始化和装配Jetty对象。这个在后面Embedding Jetty讲。 2)用Jetty XML配置(一个控制反转(IoC)框架)初始化和装配
2014-05-29 16:52:03 17215
原创 Jetty:基本功能介绍
Jetty是一个开源项目,提供了HTTP Server,HTTP Client和Javax.servlet容器,这里(http://www.eclipse.org/jetty/)是它的官方网站,这里对它做一个基本的介绍,包括基本目录、启动方式和应用部署。
2014-05-28 16:36:31 8485 1
原创 算法(一):Josephus问题
Josephus是一个著名的犹太历史学家,他有过这样的故事(来自互动百科,http://www.baike.com/wiki/Josephus):在罗马人占领乔塔帕特后,39个犹太人与Josephus及他的朋友躲到一个洞中,39个犹太人决定宁愿死也不要被人抓到,于是决定了一个自杀方式,41个人排成一个圆圈,由第1个人开始报数,每报数到第3个人该人就必须自杀,然后再由下一个重新报数,直到所有人都自杀
2014-05-26 10:08:03 5330 2
原创 并发编程实践六:ReentrantReadWriteLock
ReentrantReadWriteLock是一个读写锁,它提供了一个读锁和一个写锁,读锁用于只读操作,而写锁用于写入操作,读操作可以并行进行,而写操作则是互斥的。读锁和写锁的分离在一些写少读多的应用中可以带来性能上的提升,例如:一个hashmap在构造之后很少修改,却经常进行查找操作,这样查找操作就可以并发进行从而提高性能。这篇文章首先为你介绍读写锁的基本特性,在具体应用中需要解决的问题,然后介
2014-05-20 16:15:37 2143
原创 并发编程实践五:ReentrantLock
ReentrantLock是一个可重入的互斥锁,实现了接口Lock,和synchronized相比,它们提供了相同的功能,但ReentrantLock使用更灵活,功能更强大,也更复杂。这篇文章将为你介绍ReentrantLock,以及它的实现机制。ReentrantLock介绍通常,ReentrantLock按下面的方式使用:public class ReentrantLockTest
2014-05-14 11:17:02 3645 6
原创 并发编程实践四:实现正确和高效的锁
你是否觉得锁是一种很神奇的东西,在并发编程中,你只需要将你的代码加上锁,就能保证代码是线程安全的(当然现实和感觉有很大差别,代码的线程安全是非常复杂的),那么,这些都是怎么做到的呢?当存在大量线程同时竞争锁时,竞争失败的锁会怎么做呢?锁又是怎么保证这一切高效的执行的呢?这篇文章将为你回答这些问题,首先我将介绍怎样实现一个正确的锁,然后介绍高效的锁应该具备的条件,最后将介绍两种常用的队列锁算法:CL
2014-05-10 11:20:15 3202
原创 并发编程实践三:Condition
Condition实例始终被绑定到一个锁(Lock)上,Lock替代了Java的synchronized方法,而Condition则替代了Object的监视器方法,包括wait、notify和notifyAll(想更多的了解可以看我的博客:Java并发编程3-等待、通知和中断),而在Condition中对应为await、signal和signalAll。这篇文章主要讲述Condition的使用方法
2014-05-06 11:04:10 2381
hadoop-part3
2015-08-04
hadoop-part2
2015-08-04
hadoop-part1
2015-08-04
linux教学课件:Advanced Programming in the Linux Environment
2009-11-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人