一。ReentrantLockpublic boolean tryLock()Acquires the lock only if it is not held by another thread at the time of invocation.Acquires the lock if it is...
分类:
其他好文 时间:
2014-09-22 03:46:51
阅读次数:
246
void lock()Acquires the lock.If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant unt...
分类:
其他好文 时间:
2014-09-22 01:23:41
阅读次数:
417
A multiprocessing system having a plurality of processing nodes interconnected by an interconnect network. To optimize performance during spin-lock op...
分类:
移动开发 时间:
2014-09-22 00:56:21
阅读次数:
394
原文:5. SQL Server数据库性能监控 - 当前请求对于在线运行的系统,当前数据库性能监控,通常监视以下几点:
(1) 是否有阻塞 (Blocking);
(2) 是否有等待 (Waiting),阻塞就是锁 (Lock) 等待;
(3) 是否运行时间过长(Long running);
(4)...
分类:
数据库 时间:
2014-09-21 22:16:21
阅读次数:
314
一: 声明控件。 TextView hasnumTV; TextView hasnum;// 用来显示剩余字数 int num = 50;// 限制的最大字数二: 基本的方法: hasnumTV = (TextView) findViewById(R.id.tv_num); ...
分类:
移动开发 时间:
2014-09-21 20:02:01
阅读次数:
237
Condition的含义是条件变量,其实现依赖于系统,一般都要配合Mutex使用,使用步骤为:给mutex上锁(Lock),调用wait等待“条件”发生,如果没有发生则re-wait(),最后释放mutex(unlock),并继续执行。所有等待(wait)同一个“条件变量(condition)”的线...
分类:
移动开发 时间:
2014-09-21 18:37:51
阅读次数:
410
常识,之前有的没搞清楚,导致写代码时不少疑惑。
比较典型的同步例子,用了两个Condition,notEmpty和notFull,分别对应两个lock,takeLock和putLock。查看take的代码:
E x;
int c = -1;
final AtomicInteger count = this.count;
final AtomicInteger takeLock = thi...
分类:
数据库 时间:
2014-09-21 01:53:59
阅读次数:
533
樹狀數組支持區間修改與區間查詢,很久沒編,又快忘了,編程時要注意的兩點是:1、樹狀數組前綴和可能會爆int 2、用%d讀入long long即使輸入數據保證小於10^9也可能出問題 記錄差分數組a[i]=num[i]-num[i-1];sum[i]=sum[1]+sum[2]+...+sum[...
分类:
其他好文 时间:
2014-09-21 01:13:29
阅读次数:
311
function getType(num) getType=num select case num case "202" : getType="文本" case "203" : getType="备注" case "3" : get...
分类:
数据库 时间:
2014-09-20 16:00:19
阅读次数:
217
1.计算,并输出其结果。 思路是先设计一个函数计算阶乘,再用循环,逐个求和。 #include int mul(int n) { int num,i; num=1; for(i=1;i
int mul(int n)
{ int num,i; num=1; for(i=1;i
double mul(i...
分类:
编程语言 时间:
2014-09-20 15:08:28
阅读次数:
185