![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
java基础
慢慢的学习
这个作者很懒,什么都没留下…
展开
-
redis 安装主从
包获取地址http://download.redis.io/releases/单机环境下安装wget http://download.redis.io/releases/redis-6.2.6.tar.gztart -zxvf redis-6.2.6.tar.gzmv redis-6.2.6.tar.gz rediscd ./redismakecd ./srcmake install# 启动redis./redis-server# 连接redisredis-cli -h 127.0原创 2021-12-23 16:20:15 · 606 阅读 · 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 · 135 阅读 · 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 · 317 阅读 · 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 · 91 阅读 · 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 · 68 阅读 · 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 · 297 阅读 · 0 评论 -
jmeter安装使用
下载安装https://jmeter.apache.org/download_jmeter.cgiwindows机器下载zip包,解压jmeter安装依赖java环境,请配置好java环境,这个就不写了配置jmeter环境变量配置JMETER_HOMEC:\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 · 234 阅读 · 0 评论 -
JAVA线程池
newCachedThreadPoolExecutors/**注意:这个是网易翻译结果,英文好的请忽略中文注释创建一个线程池,该线程池根据需要创建新的线程,但在前面构建的线程可用时将重用它们。这些池通常会提高执行许多短时间异步任务的程序的性能。执行调用将重用先前构造的线程(如果可用)。如果没有可用的线程,将创建一个新线程并将其添加到池中。超过60秒未被使用的线程将被终止并从缓存中删除。因此,保持足够长的空闲时间的池将不会消耗任何资源。注意,具有类似属性但细节不同(例如,超时参数)的池可以使原创 2021-12-13 17:42:17 · 183 阅读 · 0 评论 -
ReentrantReadWriteLock
ReentrantReadWriteLockSyncNonfairSyncFairSyncReadLockWriteLocktryAcquire protected final boolean tryAcquire(int acquires) { /* * Walkthrough: * 1. If read count nonzero or write count nonzero原创 2021-12-13 17:30:17 · 164 阅读 · 0 评论 -
查看java的安装目录
1 which java /usr/bin/java2 ls -lrt /usr/bin/java /usr/bin/java -> /etc/alternatives/java3 ls -lrt /etc/alternatives/java/etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java原创 2021-12-09 11:31:24 · 2046 阅读 · 0 评论