java 多线程 并发 之 CountDownLatch
CountDownLatch 与 CyclicBarrier 的最大区别是不可以重复使用, 如果需要多个线程集合点, 需要多个 CountDownLatch 实例.
同时它也不可以reset.
CountDownLatch 与 CyclicBarrier 的最大区别是不可以重复使用, 如果需要多个线程集合点, 需要多个 CountDownLatch 实例.
同时它也不可以reset.
首先, 这是一篇很好的教程: CyclicBarrier的用法
需要注意的其他点:
Subject: Restart due to high load
CC:tian@gmail.com
To:admin@tianxiaohui.com
From:test@tianxiaohui.com
Restart due to high load on router
cat var/test/routerRestartMail.txt | sendmail -S"smtp.163.com" -au"我的163邮箱用户名" -ap"163邮箱密码" -f"发送者邮箱名@163.com"
root@home:/opt/var/eric# sendmail
BusyBox v1.18.4 (2013-05-26 18:44:50 CST) multi-call binary.
Usage: sendmail [OPTIONS] [RECIPIENT_EMAIL]...
Read email from stdin and send it
Standard options:
-t Read additional recipients from message body
-f sender Sender (required)
-o options Various options. -oi implied, others are ignored
-i -oi synonym. implied and ignored
Busybox specific options:
-w seconds Network timeout
-H 'PROG ARGS' Run connection helper
Examples:
-H 'exec openssl s_client -quiet -tls1 -starttls smtp
-connect smtp.gmail.com:25' <email.txt
[4<username_and_passwd.txt | -au<username> -ap<password>]
-H 'exec openssl s_client -quiet -tls1
-connect smtp.gmail.com:465' <email.txt
[4<username_and_passwd.txt | -au<username> -ap<password>]
-S server[:port] Server
-au<username> Username for AUTH LOGIN
-ap<password> Password for AUTH LOGIN
-am<method> Authentication method. Ignored. LOGIN is implied
Other options are silently ignored; -oi -t is implied
之前一直使用的是startSSL的证书, 这个证书是免费的, 虽然startSSL 宣称它的证书浏览器都认, 不过发现在有些浏览器上面, 还是不认这个, 我的Android 手机上面就不认, 公司里面的IE 浏览器也不认, 所以就投靠了新的免费证书: 沃通.
沃通的免费证书很容易申请, 申请之后几分钟就可以下载了. 并且不需要注册.
替换: 因为之前已经设置过证书, 只要替换一把, 全都可以用.
指针 (Pointer): 指向内存的一个地址, 在C 里面, 可以对指针进行加减运算, 其实是内存地址的向前或向后, 它比较灵活, 也可以对俩个指针直接进行对比. 在内存里面, 直接对这个指针做加减运算, 就又可能到了一块无法预知的地址.
引用 (Reference): 较指针而言, 引用可以认为是一个抽象的指针, 在JVM的具体实现里面, 有的JVM可能指向的就是一块内存地址, 当然你不能对引用进行加减运算. 有的JVM里面的引用可能是只想的一个Map, 这个Map里面的值再具体指向内存的一块空间.