摘要: 假设有这样一个情况,2个人同时对一个账户在同时间段取钱,那么会发生这样的问题。 说到线程同步,需要知道两个专业术语: 阅读全文
posted @ 2020-09-05 14:49 裴敏儿 阅读(135) 评论(0) 推荐(0)
摘要: 线程的优先级:分为了10个等级,默认是5,最高是10,最低是1 public class ThreadTest09 { public static void main(String[] args) { //看看优先级别,优先级级别高只是抢占到cpu的时间片相对多一些 System.out.print 阅读全文
posted @ 2020-09-05 12:44 裴敏儿 阅读(259) 评论(0) 推荐(0)