上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要: ForkJoin ForkJoin 在 JDK 1.7 , 并行执行任务!提高效率。 大数据量! 大数据:Map Reduce (把大任务拆分为小任务) ForkJoin 特点:工作窃取 这个里面维护的都是双端队列 ForkJoinPool /** * 求和计算的任务! * 3000 6000(Fo 阅读全文
posted @ 2020-08-05 22:44 Maple_XL 阅读(86) 评论(0) 推荐(0) 编辑
摘要: Stream流式计算 大数据:存储 + 计算 集合、MySQL 本质就是存储东西的; 计算都应该交给流来操作! // 有参,无参构造,get、set、toString方法! @Data @NoArgsConstructor @AllArgsConstructor public class User 阅读全文
posted @ 2020-08-05 22:42 Maple_XL 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 4大函数式接口 新时代的程序员:lambda表达式、链式编程、函数式接口、Stream流式计算 函数式接口: 只有一个方法的接口 Function接口 源码: @FunctionalInterface public interface Function<T, R> { /** * Applies t 阅读全文
posted @ 2020-08-05 22:40 Maple_XL 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 线程池 线程池:三大方法、7大参数、4种拒绝策略 线程池的好处: 1、降低资源的消耗 2、提高响应的速度 3、方便管理。 线程复用、可以控制最大并发数、管理线程 线程池:三大方法 // Executors 工具类、3大方法 public class poolTest { public static 阅读全文
posted @ 2020-08-05 22:38 Maple_XL 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 阻塞队列 四组API public class Test { public static void main(String[] args) throws InterruptedException { test4(); } /** * 抛出异常 */ public static void test1( 阅读全文
posted @ 2020-08-05 22:36 Maple_XL 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 读写锁 public class ReadWriteLockDemo { public static void main(String[] args) { // MyCache myCache = new MyCache(); MyCacheLock myCache = new MyCacheLoc 阅读全文
posted @ 2020-08-05 22:34 Maple_XL 阅读(90) 评论(0) 推荐(0) 编辑
摘要: JUC三大常用辅助类 CountDownLatch // 计数器 public class CountDownLatchDemo { public static void main(String[] args) throws InterruptedException { // 总数是6,必须要执行任 阅读全文
posted @ 2020-08-05 22:32 Maple_XL 阅读(315) 评论(0) 推荐(0) 编辑
摘要: Callable接口 1、可以有返回值 2、可以抛出异常 3、方法不同,run()/ call() public class CallableTest { public static void main(String[] args) throws ExecutionException, Interr 阅读全文
posted @ 2020-08-05 22:30 Maple_XL 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 集合类不安全 List不安全 多线程操作List可能会出现:java.util.ConcurrentModificationException异常 // java.util.ConcurrentModificationException 并发修改异常! public class ListTest { 阅读全文
posted @ 2020-08-05 22:27 Maple_XL 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 8锁问题 如何判断锁的是谁!永远的知道什么锁,锁到底锁的是谁! /** * 8锁,就是关于锁的8个问题 * 1、标准情况下,两个线程先打印 发短信还是 打电话? 1/发短信 2/打电话 * 1、sendSms延迟4秒,两个线程先打印 发短信还是 打电话? 1/发短信 2/打电话 */ public 阅读全文
posted @ 2020-08-05 22:24 Maple_XL 阅读(106) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页