volatile提供了弱同步机制,用来确保将变量更新通知到其它线程。volatile变量不会被缓存在寄存器中或者对其它处理器不可见的地方,因此在读取volatile变量时总会返回最新写入的值。可以想象成如下语义,然而volatile是更轻量级的同步机制。volatile只能确保可见性,但不能保证原子性。也就是说不能在复合操作用volatile变量,比如i++。
public sync...
分类:
编程语言 时间:
2015-03-14 18:40:38
阅读次数:
148
make is pretty smart, and picks up what has changed from the last build, so if you run repo sync and then build without cleaning, in most cases it sho...
分类:
其他好文 时间:
2015-03-12 20:47:48
阅读次数:
238
rsync是类unix系统下的数据镜像备份工具,从软件的命名上就可以看出来了——remote sync。它的特性如下:可以镜像保存整个目录树和文件系统。可以很容易做到保持原来文件的权限、时间、软硬链接等等。无须特殊权限即可安装。优化的流程,文件传输效率高。可以使用rcp、ssh等方式来传输文件,当然...
分类:
其他好文 时间:
2015-03-12 18:50:29
阅读次数:
175
前提:释放前最好sync一下,防止丢数据方法11.清理前内存使用情况 1free-m2.开始清理 1echo3>/proc/sys/vm/drop_caches3.清理后内存使用情况 1free-m方法21、首先查看linux内存使用1free-m2、把内存数据同步到硬盘1sync3、修改 /pro...
分类:
其他好文 时间:
2015-03-12 14:44:26
阅读次数:
406
方法1."Build " -> "Clean project"方法 2."Tools" -> "Android" -> "Sync Project with Gradle Files"方法3.updatedyour SDK manager.不知道大家遇到是怎么解决的,方法2对我有用。
分类:
移动开发 时间:
2015-03-12 09:48:21
阅读次数:
901
[root@mode tools]# echo 'export LC_ALL=C'>>/etc/profile
[root@mode tools]# tail -l /etc/profile
done
unset i
unset pathmunge
export PATH=$PATH:/usr/local/sersync/bin
export PATH=$PATH:/usr/local/mysq...
分类:
其他好文 时间:
2015-03-11 23:29:12
阅读次数:
155
看过好几遍了,觉得挺实用的,记录备忘一下。1.开启很多个goroutine 之后,等待执行完毕type WaitGroupWrapper struct { sync.WaitGroup}func (w *WaitGroupWrapper) Wrap(cb func()) { w.Add(...
分类:
其他好文 时间:
2015-03-10 15:26:09
阅读次数:
172
实现步骤:
1.服务器端:sudo apt-get install portmap
2.服务器端:sudo apt-get install nfs-kernel-server
3.客户端:sudo apt-get install nfs-common
4.服务器端配置:sudo gedit /etc/exports
添加:/home *(rw,sync,...
分类:
系统相关 时间:
2015-03-09 16:14:35
阅读次数:
243
很简单呢的一道题,定义了一个结构体数组,用vector来做为一个牌堆。将尾部作为牌堆的顶部。
要注意,当最后只剩一堆牌的时候,答案中的pile不加s
#include
using namespace std;
const int maxn = 60;
int b[60];
struct pile {
vector a;
};
int main() {
ios::sync_wit...
分类:
其他好文 时间:
2015-03-09 14:28:41
阅读次数:
133
关闭虚拟机防火墙 lokkit --disabled配置NFS服务端 建立一个目录用来共享 存放根文件系统cd / mkdir rootfs配置NFS共享目录gedit /etc/exports写入/rootfs*(rw,sync,no_root_squash) //其中/rootf...
分类:
其他好文 时间:
2015-03-08 00:02:08
阅读次数:
486