随笔分类 -  多线程

摘要:try { LockAssert.startLock(lockName); logger.debug("Locked '{}', lock will be held at most until {}", lockName, lockConfig.getLockAtMostUntil()); retu 阅读全文
posted @ 2020-11-11 14:36 tonggc1668 阅读(178) 评论(0) 推荐(0)
摘要:Netty事件监听和处理(下) https://www.jianshu.com/p/a41be671b999 这可能是目前最透彻的Netty原理架构解析 https://www.sohu.com/a/272879207_463994 阅读全文
posted @ 2020-05-25 18:40 tonggc1668 阅读(120) 评论(0) 推荐(0)
摘要:import java.util.concurrent.atomic.AtomicReference; public class Test { private static AtomicReference<Long> currentTime = new AtomicReference<>(15876 阅读全文
posted @ 2020-04-23 15:30 tonggc1668 阅读(120) 评论(0) 推荐(0)
摘要:package com.citi.tm.api.trade.mongo; public class ThreadTest { public static void main(String[] args) { Runnable r = () -> { try { //Thread.currentThread().sleep(15000);//a, b, sleep Thread.sleep(1500 阅读全文
posted @ 2019-12-17 16:43 tonggc1668 阅读(245) 评论(0) 推荐(0)
摘要:https://www.jianshu.com/p/4682a6b0802d https://www.cnblogs.com/waterystone/p/4920797.html 阅读全文
posted @ 2019-07-30 15:44 tonggc1668 阅读(132) 评论(0) 推荐(0)
摘要:package com.test; public class InterruptionInJava implements Runnable{ public static void main(String[] args) throws InterruptedException { Thread testThread = new Thread(new Interruption... 阅读全文
posted @ 2018-11-30 11:34 tonggc1668 阅读(148) 评论(0) 推荐(0)
摘要:package com.zhy.concurrency.timer; import java.util.Date; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorSer... 阅读全文
posted @ 2018-07-12 14:27 tonggc1668 阅读(109) 评论(0) 推荐(0)
摘要:线程池 setDefaultUncaughtExceptionHandler不是setUncaughtExceptionHandler 阅读全文
posted @ 2017-11-13 20:04 tonggc1668 阅读(131) 评论(0) 推荐(0)
摘要:固定线程池默认抛弃策略,线程超过数量被抛弃不执行,但是队列默认数量是整形的最大数,一般是超不过队列数量加线程池数量 spring线程池 阅读全文
posted @ 2017-08-18 09:29 tonggc1668 阅读(220) 评论(0) 推荐(0)
摘要:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 阅读全文
posted @ 2017-08-03 17:05 tonggc1668 阅读(517) 评论(0) 推荐(0)
摘要:import java.util.concurrent.Callable; public class MyCallable implements Callable { private String name; public MyCallable(String name){ this.name=name; } @Override pub... 阅读全文
posted @ 2017-08-03 16:28 tonggc1668 阅读(550) 评论(0) 推荐(0)