03 2016 档案
摘要:为了避免多个线程同时访问同一个数据而产生不可预料的结果,需要将各个线程对同一数据的访问同步。同步最常见的方法就是用锁。 接下来介绍常用的锁。 二元信号量(Binary Semaphore) Binary Semaphore是最简单的一种锁,只有两种状态:占用与非占用。适合只能被唯一一个线程独占访问的资源。 多元信号量(简称Semaphore ) Semaphore允许多个线程并发访问资源。初始值为...
阅读全文
摘要:Install npm $ sudo apt-get install npm $ sudo npm install npm –g // upgrade npm to latest version You may encounter the following error: /usr/bin/env: node: No such file or directory This is often ...
阅读全文
摘要:Bob有公钥和私钥。 Bob的公钥是公开的,任何人都可以得到。但是只有Bob有自己的私钥。公钥和私钥都可以分别用来加密信息,相应地可以用另一把钥匙解密加密后的信息。 例如,上图中Susan用Bob的公钥加密信息后,发给Bob。Bob收到信息后用自己的私钥解密,得到了Susan的信息。其他人即使获取到了信息,由于没有Bob的私钥,也不能知道信息的内容。 另外一种情况,如果Bob给Susan...
阅读全文
摘要:Installing MySQL and rsyslog-MySQL sudo apt-get install mysql-server rsyslog-mysql Set the root MySQL password when prompted and remember this password, since you will be using it in future; When in...
阅读全文
摘要:It is exciting to know Sogou input method is available on ubuntu. Download the install file from 搜狗输入法 for Linux. After Sogou input method is installed, Ubuntu need to be configured. Configure fcitx ...
阅读全文

浙公网安备 33010602011771号