摘要: import java.util.concurrent.Semaphore; public class T { public static void main(String[] args) { Semaphore semaphore = new Semaphore(3); for (int i = 阅读全文
posted @ 2024-08-15 17:10 干饭达人GoodLucy 阅读(9) 评论(0) 推荐(0) 编辑
摘要: import lombok.SneakyThrows; import java.text.SimpleDateFormat; import java.util.concurrent.*; public class T { @SneakyThrows public static void main(S 阅读全文
posted @ 2024-08-15 16:44 干饭达人GoodLucy 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import lombok.SneakyThrows; import java.util.Date; import java.util.concurrent.*; /* main上锁3 线程1获得锁 线程2获得锁 线程3获得锁 线程1释放锁2 线程2释放锁1 线程3释放锁0 main解锁0 * */ 阅读全文
posted @ 2024-08-15 15:35 干饭达人GoodLucy 阅读(4) 评论(0) 推荐(0) 编辑
摘要: fixed single cached import java.util.concurrent.*; public class T { public static void main(String[] args) { ExecutorService threadPool = getFixedThre 阅读全文
posted @ 2024-08-15 15:13 干饭达人GoodLucy 阅读(1) 评论(0) 推荐(0) 编辑
摘要: jdk自带命令行工具:jsp + jstack -l pid jdk自带可视化工具:jvisualvm jdk自带可视化工具:jconsole public class T { public static void main(String[] args) throws InterruptedExce 阅读全文
posted @ 2024-08-15 11:03 干饭达人GoodLucy 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 多条件变量 import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; /* 多条件变量 **/ 阅读全文
posted @ 2024-08-15 10:03 干饭达人GoodLucy 阅读(1) 评论(0) 推荐(0) 编辑