- 博客(9)
- 收藏
- 关注
原创 CountDownLatch
示例 CountDownLatch countDownLatch = new CountDownLatch(10); for(int i = 0;i<10;i++){ Thread thread = new Thread(() -> { System.out.println(Thread.currentThread().getName()+"在路上"); try {
2021-12-07 11:49:01
383
原创 Semaphore
示例 public void park(){ Semaphore semaphore = new Semaphore(2); for(int i=0;i<10;i++){ Thread thread=new Thread(() -> { try { System.out.println("===="+Thread.currentThread().get
2021-12-02 14:57:04
427
原创 ReentrantReadWriteLock
基本使用class RWDictionary { private final Map<String, Data> m = new TreeMap<String, Data>(); private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock(); private final Lock r = rwl.readLock(); private final Lock w = rw
2021-12-01 16:56:19
157
原创 ReentrantLock
ReentrantLock的基本使用public void reentrantLock(){ ReentrantLock reentrantLock = new ReentrantLock(); try{ reentrantLock.lock(); System.out.println(count++); }finally { reentrantLock.unlock(); }}变量//同步器,继承了AbstractQueuedSynch
2021-11-29 16:06:09
155
原创 Eureka配置
一、创建eureka server1.选择Eureka Server2.启动类添加@EnableEurekaServer注解@EnableEurekaServer3.设置配置文件#端口号server.port=7001#应用名称spring.application.name=eukserver#server端的hostnameeureka.instance.hostname=euk1#默认服务注册中心地址,多个用,隔开eureka.client.service-url.defau
2021-07-24 10:33:54
272
原创 Redis安装
下载地址https://download.redis.io/releases/redis-6.0.10.tar.gz安装步骤准备yum install wgetyum install gcc (注意gcc的版本号)安装Rediswget https://download.redis.io/releases/redis-6.0.10.tar.gztar xf redis-6.0.10.tar.gzcd redis-6.0.10makemake install PREFIX=/opt/
2021-02-11 15:38:13
84
原创 CentOS6执行yum install报错
**yum install *时报如下错误Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfileYumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release/repo/arch combination/removing mirrorlist with no valid mirrors: /var/ca
2021-02-11 14:22:32
362
1
原创 Dubbo的简单介绍和使用
官网http://dubbo.apache.org/中文https://dubbo.gitbooks.io/dubbo-user-book/content/preface/background.html介绍Dubbo是分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,AOS服务治理方案。在需要做分布式服务的时候才会需要Dubbo做服务的治理。其本质还是远程服务调用的分布式框架。应用可以通过高性能的RPC实现服务的输入和输出功能,可以和Spring框架无缝集成。核心能力:面向接口
2021-02-09 10:09:20
76
原创 idea加载maven慢
原因maven自带的仓库在国外,访问下载起来比较慢,所以将将maven访问仓库的网址设置到国内即可。解决方式1.在IDEA的安装目录下找到 /plugins/maven/lib/maven2/conf 或者 /plugins/maven/lib/maven3/conf目录2.打开setting.xml文件,将mirror标签的内容修改如下<mirror> <id>alimaven</id> <name>aliyun mave
2021-02-02 09:41:20
241
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人