java 利用同步工具类控制线程
前言
参考来源:《java并发编程实战》
同步工具类:根据工具类的自身状态来协调线程的控制流。通过同步工具类,来协调线程之间的行为。
可见性:在多线程环境下,当某个属性被其他线程修改后,其他线程能够立刻看到修改后的信息。典型的是用java内置关键字volatile,volatile变量可以让jvm知道这个变量是对所有线程共享的,jvm会做一定的同步工作,但不保证原子性。
这一部分内容可以看一下http://www.cnblogs.com/dolphin0520/p/3920373.html
http://www.cnblogs.com/Mainz/p/3556430.html#
发布和逸出:
发布:发布一个对象指,使对象能够在当前作用域之外的代码使用。举个栗子就是,对象A持有对象C,把C的引用传递到其他地方,或者外界访问A有非私有方法返回C。发布一个对象时要考虑是否有足够理由发布出去,否则可能会引起同步问题。
很明显,同步工具类肯定需要发布给通信双方。
逸出:当某个不应该发布的对象被发布时,叫做逸出。
线程之间通信,就需要把一个通信协议(某个对象)发布给双方,并且对双方来说都是可见的,这样来协调线程之间的行为。当然如果有特别需要,完全可以自己去写同步工具类。
闭锁
闭锁,可以使线程等待某个事件(信号)发生后才执行后续操作。闭锁有一个初始值,当初始值为0的时候闭锁终止,所有被该闭锁阻塞的线程都可以继续执行。假设有个线程A,我们想A启动之后需要等待线程B的信号才能继续执行,这时候我们可以把一个闭锁发布给A,B,A等待闭锁的结束,B来结束闭锁,这样A就能等B的命令才能继续执行。事实上,利用闭锁还可以让主线程等待所有子线程结束。有一点要注意的是,闭锁是一次性的,一旦进入终止状态(count==0),就不能被重置。
CountDownLatch简单用法介绍:
public CountDownLatch(int count); 构造函数,当count为0的时候,await方法不再阻塞。
public void countDown(); 使count减1。
public void await(); 使当前线程阻塞,直到CountDownLatch的count为0。
下面这个例子显示了利用闭锁控制子线程执行和等待所有子线程结束。
public class TestDownLatch {
int count = 5;
//控制子线程执行的闭锁
final CountDownLatch startGate = new CountDownLatch(1);
//让主线程等待所有子线程结束
final CountDownLatch endGate = new CountDownLatch(count); //测试线程
class Task extends Thread{ int i; public Task(int i) {
this.i = i;
} @Override
public void run() {
//等待闭锁的结束
try {
//等待主线程的命令
startGate.await();
System.out.println(i);
//告诉主线程我已经做完了
endGate.countDown();
} catch (InterruptedException igored) {
}
} } public void test(){
for (int i = 0; i < count; i++) {
Task task = new Task(i);
task.start();
}
System.out.println("所有线程已开启");
try {
Thread.sleep(3000);
startGate.countDown();
System.out.println("所有子线程开始输出"); Thread.sleep(3000);
endGate.await();
System.out.println("主线程结束");
} catch (InterruptedException ignored) {
} } public static void main(String[] args) {
TestDownLatch testDownLatch = new TestDownLatch();
testDownLatch.test();
} }
闭锁
运行结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAATcAAADFCAIAAAC+bSLDAAAMTElEQVR4nO2dObLFqBVAtS4WxHrIOnXSK3A15cg7aJedOCH3kHgLcqCJGQmJ969en1Nd7bIGxFdzdAGh+6Z5nn/59c+//f6vv/7zf//4z+z/89vv//rl1z/PAOJwRk3ant/+bqYZSwFkc8HSPwHAT0AsBZAOlgJIB0sBpIOlANJ5xlKrlXHJ1vasuNXTdG7i3Bljow3q5KnvIX8b4Q9Pr6XWGLeYMk3TNCmttbHG2NnbuFAxyersbufSpmr1NAVN2BmltipU2/ZSH23XZ0JCeHJc++YJc1CuMi4oQRkX7S5XdL06okJMt6U60+iyG/19gb2mKkRg76pkVOC2KY3Z/sWWo5xzmVCVK7eK1fX4HRfY6k44o5SqPheQFu5YmrafVhtul1A8dCnXjzXhxXLxd56dUd4xQi0tV+By9eA76bU024AuWHphJdehWnBS2n9NK4Sl8A3csDTtoZ62tDz6S1rlJppz1qhJW1/OwsX20pXWyis4Oy7NiFsZS2Mp/ACPxNKt7eanUXLiZUXIKODNT6moxUZHO2uT9hw5ciqWNqePWlNVVy29cTX4g/C0pVuTLIeBdcLknKXevhM6RYesR1x7XVOPX+lgOj9xXCasDbEUTvCkpX7gKDSwdXOxaeeN2guLzGw04fVt7PK+xz9V27nYcb5nxrM9XoB5nm++iYn08ptc/t3J5lU+ahZiqfcMCJw6Ds+/AbJaaa3W8XKwtxa073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YuS5O2k21ePxhL4+5f+nZli6+5axbqXq3e2SW2+xy485ZLVF/F5KpXmdTd31LHb4rhvfRYGn8PlnvgVy2NLUvba55w1cSJv247q/oFQHF2pmHeLQnyCzOaD7tcsEz/vsbiSXgb1y2N41Tp29LKZEa2H3c6kg6fxPyxAV5uIKGDqHm1Jw5fAbkaAKSDpQDSwVIA6WApgHSwFEA6WAogHSwFkA6WAkgHSwGkg6UA0sFSAOlgKYB0/g8Hp0aecvyjlgAAAABJRU5ErkJggg==" alt="" />
FutureTask
《java并发编程实战》的翻译者没有翻译这个词,我也只能这么叫它先。FutureTask本身实现Runnable接口和Future接口。
FutureTask相当于一个助手,你把一个任务(有返回结果并且往往比较耗时)交给FutureTask,让它先计算结果,然后你去干别的事,这个助手(FutureTask)会帮你保存结果,等你需要结果时(调用Future#get),如果计算结束了,FutureTask直接把结果给你,如果还没计算完,就让你等待(阻塞),直到计算完了。
FutureTask简单用法介绍:
public FutureTask(Callable<V> callable); 构造方法。参数Callable,相当于一种可生成结果的Runnable,相当于上面的任务(带返回结果),V为结果的类型,实现Callable需要实现call()。
public V get(); 获取Callable返回的结果,如果Callable没执行完,该方法会阻塞当前线程。
public boolean cancel(boolean mayInterruptIfRunning); 取消执行
另外还有isDone(),isCancelled()方法知道FutureTask状态;
以下代码测试FutureTask,先实例化一个FutureTask并自动获取当前时间(一秒的消耗时间),输出当时时间,然后三秒后再去FutureTask拿结果,可以看到两个时间没有三秒间隔,说明FutureTask花费一秒后算好结果就保存起来,等主线程获取结果。
public class TestFutureTask { //任务,返回计算时的时间
private final FutureTask<Date> future = new FutureTask<Date>(new Callable<Date>() {
@Override
public Date call() throws Exception {
//1秒后再返回结果
Thread.sleep(1000);
return new Date();
} }); public TestFutureTask(){
new Thread(future).start();
} public Date get() throws InterruptedException, ExecutionException{
return future.get();
} public static void main(String[] args) {
try {
System.out.println(new Date());
TestFutureTask task = new TestFutureTask();
System.out.println("等待3秒.............");
System.out.println(task.get());
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
} }
FutureTask
运行结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAATYAAABUCAIAAACHlYwbAAAI70lEQVR4nO2dO5bzNgyFtS4tSOtRlzZNVpAT7SJFavU52YVSWA+CBEAAlDy0//udacaSQVDg5UskPfzz33b+/fX3v7/98ed28DsA4KcZFIkCAH4cSBSAroFEAegaSBSAroFEAegaSBSArrlBous8DsO0POEdAL88kCgAXWOQ6DqPA8s4r+f1JyS6TMMwUNNvrQ6OjHPp7b6lz+Emy8S+w3Tq0U5iPrvqclm3bM2R0T41QMveda1WJqsQA8yXavGt5Df9emtxdbWi6zwyDj8r0XEckxTfJdE9p8s8cs94mZJPV/6emOU0gYBEjbfzcYxaNuVI+y4xvkznf6/489fy1F2V5DqPyVeKZCrxreS3zFIjN0r0qpjSWwpRkfyrvO6c50SjvDWhls08tQdzmfb7WPkVJdZRSnTLNJOSMsoixbtV8UMw4bVsypGA+hXjU41IVDehx7eS3wfakLskmiiEarBZosu2TLRKI/+c7tBHVroarW5zZ4sIMv3xmOXkyrSIypC6wB6J8gWpzbJfonpEjPbukuiZkjW+rH+0fb6H2ySajXuoctoketVcqTWmmJGEs0cdqt6YMFA7lQbPZTk3H2hFU+S8iqW6ybJbotUvnOlqRm+QKMm2Ob6c+8nt2kDWxxNj0bIr3yjRbT06u5c11hdZo7EOiC7RKwF7nhTLuc9+3efm6bfTGZJ4wRGHWjGJ1hypOt0s0ZeeuF6fHl9RorUBl5fPkOi2zuMwLYVEczO0VCf/BYcIskTFlOKWFfcjaM85MG6sWr6/FS1vlkpf+DGVnVhzfKVBUP0jJx8i0aOzq7ei+WfnyCA6RBDD0PwqiLGcl4MHJdo2rXGTRKV+tQhb/BokWrR5l1eG+Cod3cpHTt4uUUcki3mnfabbNhY97tmFHYqiY0Y39LZBnJumUN9tJbtSdFn9N1kOtMxOjd4qUV6fh1eG+IplQ694/TwuUXI5n/zVyfK7zuM4TU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bW4en/TRTpK6DGJjmO6p+VdEt1zuvCrgMkOOedKYd1ymkBAosbbnefGqJbzo1p9Th/HUKUHZyRbFeVr1IKzXqj5rMe3EsEyS43cKFH+JyMKUVV/Aya7c073nfHWhFo289QezHNDLCu/osQ6SolumWZSUoYgA9fJwfzNN1h2KUat3YyWbjimijmsWY5vJYIPtCF3STRRCNVgs0Svg6xza9Qd+shKV6PVbe5sEUGmPx6znFyZFlEZUhfYLSTh6NMbLMfOMY9ZukuiyUkgtviy/j1xKs9tEs3GPVQ5bRJNjnlIrDHFjCScPepQ9caEgdqpNHguy7n5QCuaIudVLNXNll093aoGz3S1BG+QKPHZHF/O/eR2bSDr44mxaNmVb5TotYP7ssb6Ims01gHRJXolYM+TYjn3ueU3L7gBUTpDEi846lCLHkFusWQ7AVJxulmimc/m+IoSrQ24vHyGRLd1fp1pn0k0N0NLNTmYLDREkCUqphS3rLgfQXvObZvhBcveDr/LiUOqfOkLP6bSZ3N8pUFQ/SMnHyLRo7Ort6L5Z+fIIDpEEMPQ/CqIsZyXgwcl2jatIbcpPouh6V9WKbHHxPtsja/S0a185OTtEnXUncW80z7TbRuLHvfswg5F0TGj64xCaZl5+8j38Gwlu1J0Wf1HLUf0aU9PSVj60GqM9dkYX7Fs6BWvn8clSi7nk786WX7XeXz9aGE695aNNrkAjtMUnWZTJtaVueO4ZYJzRre0rgvUPqOrW47qM0mSffeZvwQV8hR6/LrPtvgqZSN759r4DuZ5iZIh/7Q42pwif2UfRFmYQtJ2PiW2RWPKpaO+sVqmt9rnXYlHUj+04nLEMt/4ezRDLfDlRjYakWjdZyW+vrJxwxsY7HQBoGsgUQC6BhIFoGsgUQC6BhIFoGsgUQC6BhIFoGsgUQC6BhIFoGsgUQC6BhIFoGsgUQC6BhIFoGsgUQC6BhIFoGsgUQC6BhIFoGsgUQC65n8znmf3gOLnQAAAAABJRU5ErkJggg==" alt="" />
信号量
计数信号量用来控制同时访问某个特定资源的操作数量。信号量(Semaphore)维护的是一组许可,准确来说,信号量只是维护这组许可的数量。它有一个初始值,根据这个值的大小来决定每次请求许可时的行为,如果用过连接池就很容易明白,连接池里一开始放着一堆连接(Connection),每次从连接池拿出一个Connection,连接池就少一个Connection,每次Connection用完就还给连接池,方便以后的用户使用。这些资源池都拥有一个信号量,来控制资源的出入。同样,使用Semaphore可以将任何一种容器变成有界阻塞容器。
Semaphore简单用法介绍:
public Semaphore(int permits); 构造方法。参数premits为初始化信号量大小,当permits为0,获取(调用acquire方法)资源会阻塞,直到permits>0。
public void acquire() throws InterruptedException; 当permits>0时获取许可,permits会减一,否则阻塞直到permits>0。
public void release(); 释放许可,permits加一。
以下代码使用信号量简单模拟连接池,测试让连接池大小为5,然后开六个线程去获取连接,每个线程持有连接3秒,可以看到第六个线程阻塞住,要等有一个线程释放连接才可以获取到连接
public class Pool {
private final List<Connection> list;
private final Semaphore sem; public Pool(int initSize) {
//注意这里
list = Collections.synchronizedList(new LinkedList<Connection>());
for (int i = 0; i < initSize; i++) {
list.add(new Connection());
}
sem = new Semaphore(initSize);
} //获取连接
public Connection get() throws InterruptedException{
//如果sem当前许可数量为0,阻塞当前线程
sem.acquire();
return list.remove(0); } //释放连接
public void release(Connection resource) throws InterruptedException{
sem.release();
list.add(resource); } public static void main(String[] args) {
final Pool pool = new Pool(5); for (int i = 0; i < 6; i++) {
pool.new TestSemaphore(i, pool).start();
}
} public class TestSemaphore extends Thread{ final int i;
final Pool pool; public TestSemaphore(int i,Pool pool) {
this.i = i;
this.pool = pool;
} @Override
public void run() {
try {
Connection conn = pool.get();
System.out.println(i+"成功获取资源并占用三秒!");
Thread.sleep(3000);
pool.release(conn);
System.out.println(i+"已释放资源!!!");
} catch (InterruptedException e) {
System.out.println(i+"获取资源失败----");
}
}
} }
信号量
运行结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQoAAAE5CAIAAADnR/mdAAAZzklEQVR4nO2dudHlOndFb1qPASGdpidXjiJQCaUkpPplw9cQBWVwwHQOCHAm31rVRn+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B4AK8gBQQR4AKsgDQIUVuwAqrNgFUKFxBaCCPABUkAeACvIAUEEeACrIA0CFeQ8AFeY9AFRoXAGoIA8AFeQBoII8AFT+HxFovDLrhJGsAAAAAElFTkSuQmCC" alt="" />
特别注意:Pool的构造方法用Collections.synchronizedList方法使保存连接的list变成线程安全,在调用list的方法时会自动加锁,但是如果用迭代器访问list的时候需要手动加锁,这一点在Collections的API文档有特别说明。
栅栏
栅栏跟闭锁很像,先说栅栏的作用——阻塞一组线程直到某个事件发生。闭锁和栅栏的最大区别就是,栅栏可以让所有线程必须同时到达栅栏位置,才能继续执行,闭锁最多做到线程执行到阻塞的位置必须等待闭锁的终止,而无法保证线程等待其他线程的执行。栅栏就像赛马的那个栏(我也不知道叫什么),所有马到了起点,栅栏一开,所有马都开始跑,闭锁是没办法知道所有马都到达栅栏处的。
CyclicBarrier简单用法介绍:
public CyclicBarrier(int parties, Runnable barrierAction); 构造方法。parties指一共有多少个线程,barrierAction就是所有线程通过栅栏的时回调函数。
public int await() throws InterruptedException, BrokenBarrierException; 当前线程等待其他所有线程到达(也是等待栅栏打开)。
CyclicBarrier是指可以循环使用的栅栏,每次栅栏打开后都能重置以便下次使用。但是如果对await的调用超时,或者await阻塞的线程被中断,栅栏被认为是打破,所有阻塞的await调用都抛出BrokenBarrierException。
以下代码用栅栏使所有五个召唤师都到达战场后游戏开始,从开始连接到全军出击的时间差应该是五个召唤师最慢那个,就是LOL时半天进度条也没100的那个。虽然我戒撸很久了= =
public class TestBarrier {
private final CyclicBarrier barrier; public TestBarrier() {
this.barrier = new CyclicBarrier(5, new Runnable() {
@Override
public void run() {
System.out.println(new Date()+"...全军出击!");
}
});
} public void start(){
System.out.println(new Date()+"开始连接-----");
new Summoner(1,3).start();
new Summoner(2,1).start();
new Summoner(3,5).start();
new Summoner(4,6).start();
new Summoner(5,1).start();
} public class Summoner extends Thread{ int i;
int preSecond; public Summoner(int i,int preSecond) {
this.i = i;
this.preSecond = preSecond;
} @Override
public void run() {
try {
System.out.println("召唤师"+i+"需要"+preSecond+"秒到达战场");
Thread.sleep(preSecond*1000);
barrier.await();
System.out.println("------------ 召唤师"+i+":"+new Date());
} catch (InterruptedException | BrokenBarrierException e) {
e.printStackTrace();
}
} } public static void main(String[] args) {
new TestBarrier().start();
} }
栅栏
运行结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgsAAAEvCAIAAABE6BUkAAAgAElEQVR4nO29O7LsOgyd3ePSgDgeZh6BR+CyypFn8P9lJ06U+5F4Cu2g9QDIBRCk1A/ts766VefubomkKDUWCVLA47/+j//73//3U/73n/+///kf/uN/ehJCCPm3eVAhCCGEQKgQhBBCMFQIQgghGCoEITdiySmlPJcfTmnGx1vM6fGY8uIfMk1FTUtO/jnkr0GFIOTDzOmxMeVlydND/l18XZ9bffgqAWvEkif0DSoGHFOfaZRH/iqXKcSSJ+shJYRgljwpS90ywOXxz+fTMOXq6ykvQphSlqK0U5ZxFLvk6THlfCjXY5om4yzyt6BCEPI9OhUCCQQUDUWpIJEJRHXakqXHaVnobPo3CCvEAocdx0T4bQqxjnxk0R9Vo+3CUX1zqvrhmpJ1b3cW7bZKldzXh5U7xKhzbHCpStDn6t44vms9k6euqGwTKtN7NorTjUOiCvEq6hi5H2XKNYjGZCJ4lHUvhbBwPPjPMDCHWPJkWZ63KcQ0yR/Sp57P9Upn7Oadk/jUcwX3lqwKtvrbwm2VLrmop93ioxGvmyLaFFj49Msui9v/AlXVFfX10XGOc0WN++s/G+CSzEZ0zCEONdjPK3tjTo17Ks5s3P5KSfbGccH63+FyhTiGZfKQyqbHrdPryCx/Sbg0Y4xZtDRuS/YhE7T+lUnsMFJXlFxbtOa5dZ9Du45LLijbdEIhXHEN9uqIQvhF+HfBv4MdQ5guhRAHv6y3Plv8CtYiwCTmmAg0JxzrAXKiVSyku9Mj8ie4ViHKh3N/dk4rxCwfaFWabo7+xdZNHR1slo2tDAhwho2VHOurtTrg6zFbBS4d9QYuudXycYXw70hwbnaVQuw1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HRqfIxg37F2pvbgrUTgj5MwCF+C//7f9QIf4qzfn9Ms/HTkVPaKgQhPx9gELM////okIQQgjhHIIQQgiG6xCEEEIwVAhCCCEYKgQhhBAMFYIQQgiGCkEIIQRDhSCEEIKhQhBCCMFQIQghhGCoEIQQQjBUCEIIIRgqBCGEEAwVghBCCIYKQQghBEOFIIQQgqFCEEIIwVAhCCGEYKgQhBBCMFQIQgghGCoEIYQQDBWCEEIIhgpBCCEEQ4UghBCCoUIQQgjBUCEIIYRgqBCEEEIwVAhCCCEYKgQhhBDM/wNZ/PhVVeZZUwAAAABJRU5ErkJggg==" alt="" />
小结
闭锁:当你的线程需要等待一个命令的时候可以用它。
FutureTask:当你有个耗时的过程想利用并行来提高效率,可以用FutureTask。
信号量:当你在多线程环境下想控制有限资源的访问,使一个容器变成有界阻塞容器,可以考虑信号量。
栅栏:当你的多个线程需要共同完成某些步骤才可以继续执行,例如子问题结果合并,可以使用栅栏。
java 利用同步工具类控制线程的更多相关文章
- Java多线程同步工具类之CountDownLatch
在过去我们实现多线程同步的代码中,往往使用join().wait().notiyAll()等线程间通信的方式,随着JUC包的不断的完善,java为我们提供了丰富同步工具类,官方也鼓励我们使用工具类来实 ...
- Java并发——同步工具类
CountDownLatch 同步倒数计数器 CountDownLatch是一个同步倒数计数器.CountDownLatch允许一个或多个线程等待其他线程完成操作. CountDownLatch对象 ...
- Java多线程同步工具类之Semaphore
Semaphore信号量通常做为控制线程并发个数的工具来使用,它可以用来限制同时并发访问资源的线程个数. 一.Semaphore使用 下面我们通过一个简单的例子来看下Semaphore的具体使用,我们 ...
- Java多线程同步工具类之CyclicBarrier
一.CyclicBarrier使用 CyclicBarrier从字面上可以直接理解为线程运行的屏障,它可以让一组线程执行到一个共同的屏障点时被阻塞,直到最后一个线程执行到指定位置,你设置的执行线程就会 ...
- Java核心知识点学习----线程同步工具类,CyclicBarrier学习
线程同步工具类,CyclicBarrier日常开发较少涉及,这里只举一个例子,以做备注.N个人一块出去玩,相约去两个地方,CyclicBarrier的主要作用是等待所有人都汇合了,才往下一站出发. 1 ...
- Java并发编程-并发工具类及线程池
JUC中提供了几个比较常用的并发工具类,比如CountDownLatch.CyclicBarrier.Semaphore. CountDownLatch: countdownlatch是一个同步工具类 ...
- 《java并发编程实战》读书笔记4--基础构建模块,java中的同步容器类&并发容器类&同步工具类,消费者模式
上一章说道委托是创建线程安全类的一个最有效策略,只需让现有的线程安全的类管理所有的状态即可.那么这章便说的是怎么利用java平台类库的并发基础构建模块呢? 5.1 同步容器类 包括Vector和Has ...
- Java并发(基础知识)——显示锁和同步工具类
显示锁 Lock接口是Java ...
- Java并发之同步工具类
1. CountDownlatch(计数器) 描述: 一个同步工具类,允许一个或多个线程等待其它线程完成操作 类图 通过指定的count值进行初始化,调用await方法的线程将被阻塞,直到count值 ...
随机推荐
- ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value:
今天碰到一个相当棘手的问题,那就是ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value . 本来在本地测试是没有任 ...
- App服务端架构变迁
随着移动互联网时代的到来,移动技术也随之飞速发展.如今,App已然成为绝大多数互联网企业用来获取用户的核心渠道.以往以PC为主要承载平台的各业务线,源源不断集成加入到移动项目中来,原本以产品为中心快速 ...
- Unity3D性能优化小tips——把this.transform缓存缓存起来
Unity3D开发时中有一个小tips,这在官方的文档里其实有提及的,但不那么显眼,这里小说一下: 在MonoBehaviour进行编程时,我们经常会用this.transform, this.gam ...
- visio 画图工具
1.线条 [设计] --- [页面设置]----打开 对话框 [布局与排列]-----[排列] ---- [样式] --- [直 2.word中插入viso 插入→对象→visio
- 解决树莓派新内核无法使用18B20和没有声音的问题
现在新版的树莓派内核由于为了兼容树莓派2和树莓派B+等以前的版本,采用了和原来不同的内核运行方式,使用了设备树的方式,更加灵活.但是由于可能不习惯这样的方式以及没太多相关这方面的介绍,导致很多用户更新 ...
- dmesg 时间转换脚本
https://linuxaria.com/article/how-to-make-dmesg-timestamp-human-readable perl脚本 #!/usr/bin/perl use ...
- struts result动态结果集 带参数的结果集
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC &qu ...
- Docker学习笔记之一,搭建一个JAVA Tomcat运行环境(转)
前言 Docker旨在提供一种应用程序的自动化部署解决方案,在 Linux 系统上迅速创建一个容器(轻量级虚拟机)并部署和运行应用程序,并通过配置文件可以轻松实现应用程序的自动化安装.部署和升级,非常 ...
- springmvc管理资源开放
关于web.xml的url映射的小知识:<url-pattern>/</url-pattern> 会匹配到/login这样的路径型url,不会匹配到模式为*.jsp这样的后缀 ...
- js 父窗口与子窗口交互
showModalDialog 父窗口 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ...