java
java基础
慢慢的学习
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
redis 安装主从
包获取地址 http://download.redis.io/releases/ 单机环境下安装 wget http://download.redis.io/releases/redis-6.2.6.tar.gz tart -zxvf redis-6.2.6.tar.gz mv redis-6.2.6.tar.gz redis cd ./redis make cd ./src make install # 启动redis ./redis-server # 连接redis redis-cli -h 127.0原创 2021-12-23 16:20:15 · 668 阅读 · 0 评论 -
Thread-yield
/** * A hint to the scheduler that the current thread is willing to yield * its current use of a processor. The scheduler is free to ignore this * hint. * * <p> Yield is a heuristic attempt to improve relative progressio...原创 2021-12-22 16:26:56 · 222 阅读 · 0 评论 -
Thread-Wait
实例 package com.example.demo.thread; public class WaitTest { public static Object lock = new Object(); public static void main(String[] args) throws InterruptedException { WaitThread1 waitThread1 = new WaitThread1(); WaitThread2 wa原创 2021-12-22 16:15:08 · 404 阅读 · 0 评论 -
Thread-Join
/** * Waits at most {@code millis} milliseconds for this thread to * die. A timeout of {@code 0} means to wait forever. * * <p> This implementation uses a loop of {@code this.wait} calls * conditioned on {@code this.isAl...原创 2021-12-22 15:58:32 · 165 阅读 · 0 评论 -
SynchronousQueue
A blocking queue in which each insert operation must wait for a corresponding remove operation by another thread, and vice versa. A synchronous queue does not have any internal capacity, not even a capacity of one. You cannot peek at a synchronous queue be原创 2021-12-21 18:05:19 · 124 阅读 · 0 评论 -
java集合
public static void main(String[] args) { /** * 线程安全 */ Hashtable<String, String> hashtable = new Hashtable<>(); hashtable.put("abc", "afc"); System.out.println(hashtable.get("abc")); /原创 2021-12-21 17:54:15 · 354 阅读 · 0 评论 -
jmeter安装使用
下载安装 https://jmeter.apache.org/download_jmeter.cgi windows机器下载zip包,解压 jmeter安装依赖java环境,请配置好java环境,这个就不写了 配置jmeter环境变量配置JMETER_HOME C:\Users\Administrator\Desktop\apache-jmeter-5.4.1\apache-jmeter-5.4.1 配置path %JMETER_HOME%\lib\ext\ApacheJMeter_core.jar %J原创 2021-12-14 10:04:05 · 307 阅读 · 0 评论 -
JAVA线程池
newCachedThreadPool Executors /** 注意:这个是网易翻译结果,英文好的请忽略中文注释 创建一个线程池,该线程池根据需要创建新的线程,但在前面构建的线程可用时将重用它们。 这些池通常会提高执行许多短时间异步任务的程序的性能。执行调用将重用先前构造的线程(如果可用)。 如果没有可用的线程,将创建一个新线程并将其添加到池中。 超过60秒未被使用的线程将被终止并从缓存中删除。 因此,保持足够长的空闲时间的池将不会消耗任何资源。 注意,具有类似属性但细节不同(例如,超时参数)的池可以使原创 2021-12-13 17:42:17 · 232 阅读 · 0 评论 -
ReentrantReadWriteLock
ReentrantReadWriteLock Sync NonfairSync FairSync ReadLock WriteLock tryAcquire protected final boolean tryAcquire(int acquires) { /* * Walkthrough: * 1. If read count nonzero or write count nonzero原创 2021-12-13 17:30:17 · 243 阅读 · 0 评论 -
查看java的安装目录
1 which java /usr/bin/java 2 ls -lrt /usr/bin/java /usr/bin/java -> /etc/alternatives/java 3 ls -lrt /etc/alternatives/java /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java原创 2021-12-09 11:31:24 · 2208 阅读 · 0 评论
分享