摘要:
1 private class SumTask extends RecursiveTask<Long> { 2 3 private static final int THRESHOLD = 1250000; 4 5 private long arr[]; 6 private int start; 7 private int end; 8 9 public SumTask(long[] arr, i 阅读全文
posted @ 2020-01-12 14:55
草根玉堂
阅读(1746)
评论(0)
推荐(1)
摘要:
代码片段 synchronized代码块主要是靠monitorenter和monitorexit这两个原语来实现同步的。当线程进入monitorenter获得执行代码的权利时,其他线程就不能执行里面的代码,直到锁Owner线程执行monitorexit释放锁后,其他线程才可以竞争获取锁。 普通方法 阅读全文
posted @ 2020-01-12 14:52
草根玉堂
阅读(7352)
评论(0)
推荐(2)

浙公网安备 33010602011771号