加载中
java的问答知识区二

游戏规则,采用问答的方式进行知识的巩固; (1) 谈谈对nacos的理解, 1.1 nacos 客户端的注册 nacos-client注册流程简图 nacos-client AP集群--服务注册 nacos-client AP集群--发送心跳 nacos-...

04/02 23:26
26
java的问答知识区一

游戏规则,采用问答的方式进行知识的巩固; (1) 有那几种隔离级别? 1.1 有四种隔离级别,其分别是 读未提交,读已提交,可重复读,串行化读写 1.2 隔离,是事务中ACID中的重要一个环;数据库提供隔离...

03/30 22:32
336
copyOnWrite容器

copyOnWrite 读写分离 //写 public boolean add(T e) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] elements = getArray(); int ...

2018/02/07 11:12
30
java线程--无锁CAS(CompareAndSet比较交换)

无锁线程安全整数 public class Test { static AtomicInteger ai = new AtomicInteger(0); static class MyTask implements Runnable { @Override public ...

2018/01/29 18:40
3.2K
java线程--ThreadLocal的简单使用

ThreadLocal的简单使用 public class Test { static ThreadLocal<SimpleDateFormat> t1 = new ThreadLocal<SimpleDateFormat>(); static class MyTask implements Runnable { ...

2018/01/29 10:53
132
java线程--提高"锁"的效率

1.减少锁的持有时间 案例jdk 中Pattern类代码片段 双重检查,减少锁的持有时间 /** * Creates a matcher that will match the given input against this pattern. * * @p...

2018/01/25 17:42
117
java线程--分治法fork()

分治法fork() public class Test { public static final int THRESHOLD = 10; static class CountTask extends RecursiveTask<Long> { private static final long serial...

2018/01/25 15:39
204
java线程--打印错误堆栈信息

public class Test { static class MyTask implements Runnable { int a,b; public MyTask(int a,int b){ this.a=a; this.b=b; } ...

2018/01/25 15:38
2.5K
java线程池--Executor

jdk线程池 public interface Executor void execute(Runnable command); public interface ExecutorService extends Executor List<Runnable> shutdownNow(); Future<?> subm...

2018/01/24 17:55
50
java线程--倒计时器CountDownLatch

倒计时器CountDownLatch使用个例 public class Test { static final CountDownLatch end = new CountDownLatch(10); static class CounDownLatchDemo implements Runnable { ...

2018/01/24 16:00
208
java线程--ReentrantReadWriteLock读写锁

读写锁的使用个例 public class Test { static Lock lock = new ReentrantLock(); static ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock(); static Loc...

2018/01/24 15:48
14
java线程--信号量Semaphore

Semaphore 使用个例 public class Test { static class SemapDemo implements Runnable { Semaphore semaphore = new Semaphore(5); @Override public void ...

2018/01/24 14:58
44
java线程--Condition

Conditon 使用方法 public class Test { public static ReentrantLock lock = new ReentrantLock(true); public static Condition condition = lock.newCondition(); static c...

2018/01/24 11:31
4
java线程--重入锁

重入锁re-entrant-lock public class Test { static class Reenter implements Runnable { public static ReentrantLock lock = new ReentrantLock(); public static ...

2018/01/23 19:08
11
java线程--守护线程

public class Test { public static void main(String[] args) throws InterruptedException { DaemonThread daemon = new DaemonThread(); daemon.setDaemon(true); ...

2018/01/23 15:59
14
java线程--线程组

线程组例子 public class Test { public static void main(String[] args) { ThreadGroup tg = new ThreadGroup("group"); Thread t1 = new Thread(tg, new ThreadGroup...

2018/01/23 15:32
32
java线程--thread.join

join() 使用个例 public class Test { static volatile int i=0; static class T1 extends Thread { @Override public void run() { for(;i<100;i+...

2018/01/23 14:52
4
java线程--object.wait&&object.notify

object.wait&&object.notify public class Test { final static Object obj = new Object(); static class T1 extends Thread { @Override public void run() { ...

2018/01/23 14:41
24
java线程--Thread.interrupt&&Thread.sleep

interrupt when sleep public class Test { public static void main(String[] args) throws InterruptedException { Thread t1 = new Thread(){ @Override ...

2018/01/23 11:30
140
动态规划练习1--Unique Paths

题目内容 [引自] https://leetcode.com/problems/unique-paths/description/ A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robo...

2018/01/11 14:31
63

没有更多内容

加载失败,请刷新页面

返回顶部
顶部