zno2

随笔分类 -  java thread

Synchronization in Java
摘要:Synchronization in Java, Part 1: Race conditions, locks, and conditions https://blogs.oracle.com/javamagazine/post/java-thread-synchronization-racecon 阅读全文

posted @ 2023-08-03 19:47 zno2 阅读(69) 评论(0) 推荐(0)

显示锁,隐式锁 (管程、monitor 、操作系统)
摘要:无锁时并发出问题 import java.util.*; /** * 无锁 * @author witas * */ public class Bank { public static void main(String[] args) { final int NACCOUNTS = 100; fin 阅读全文

posted @ 2023-08-03 19:47 zno2 阅读(66) 评论(0) 推荐(0)

volatile 用与不用的区别,适用哪些场景
摘要:/** * volatile 使得变量在各线程之间实时共享 * 是为了解决内存一致性问题 * * Using volatile variables reduces the risk of memory consistency errors, * because any write to a vola 阅读全文

posted @ 2023-06-02 08:17 zno2 阅读(65) 评论(0) 推荐(0)

深入了解定时任务(一)
摘要:单词辅助记忆 scheduled 车堵了? 线索 java.util.concurrent.Future<V>site:spring.io taskhttps://docs.spring.io/spring-framework/docs/4.2.x/spring-framework-referenc 阅读全文

posted @ 2023-06-02 08:07 zno2 阅读(74) 评论(0) 推荐(0)

一) Thread 两种实现方式
摘要:https://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.1 https://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.19 http:// 阅读全文

posted @ 2023-06-01 16:21 zno2 阅读(33) 评论(0) 推荐(0)

join()
摘要:1)谁等待这个线程结束 2)等多久 public final synchronized void join(long millis) throws InterruptedException { long base = System.currentTimeMillis(); long now = 0; 阅读全文

posted @ 2018-12-19 16:44 zno2 阅读(190) 评论(0) 推荐(0)

导航