l*s
2 楼
比如说,股票的历史记录是子表,把所有的股票汇总起来就是一个总表,怎么通过总表
访问部分子表的数据?还是干脆开目录写文件算了?
访问部分子表的数据?还是干脆开目录写文件算了?
c*e
3 楼
One class has a List- , and exposes it as an unmodifiable list:
public List- getItems() {
syncrhonized (this.items) {
return Collections.unmodifiableList(this.items):
}
}
this.items may be accessed by multiple threads. It is possible new item may
be added or removed while the caller is reading through the list obtained
from getItems(). But what the caller needs is just a best-effort snapshot
of the items, and missing a few new items is ok for the caller. Does the
above method work? In other words, can the caller safely navigate through
the snapshot data without any data corruption?
Maybe a fully thread-safe approach is just to return a new list:
public List- getItems() {
synchronized(this.items) {
return new ArrayList- (this.items);
}
}
是不是太浪费了?
碰到这种问题,大家都是怎样处理的? 谢谢。
public List
syncrhonized (this.items) {
return Collections.unmodifiableList(this.items):
}
}
this.items may be accessed by multiple threads. It is possible new item may
be added or removed while the caller is reading through the list obtained
from getItems(). But what the caller needs is just a best-effort snapshot
of the items, and missing a few new items is ok for the caller. Does the
above method work? In other words, can the caller safely navigate through
the snapshot data without any data corruption?
Maybe a fully thread-safe approach is just to return a new list:
public List
synchronized(this.items) {
return new ArrayList
}
}
是不是太浪费了?
碰到这种问题,大家都是怎样处理的? 谢谢。
z*3
5 楼
data warehousing or data integration? some bi tools ssis
f*n
6 楼
No, it is not safe.
b*e
7 楼
怎么才能开出是明代的?看雕工?
z*e
9 楼
copyonwritearraylist
j*n
11 楼
You'd understand what is Normalization first.
t*e
12 楼
那个synchronized一点用都没有。还是web programming好啊,concurrency都扔给数据
库处理了。
库处理了。
z*3
16 楼
老大,你的意思是不是就是drill down,比如上一个level的时候就是select sum(
price) from stock cube by pub_date,下一个level就是select sum(price) cube by
location,pub_date?如果这样的话,你就建个cube吧。
price) from stock cube by pub_date,下一个level就是select sum(price) cube by
location,pub_date?如果这样的话,你就建个cube吧。
相关阅读
Re: Regular Expression in JavaRe: weblogic questionJava basic concept(2)Re: 请教一个问题—servletJSP for the ASP DeveloperRe: AWT 和 SWING 在程序应用中有什么区别?Re: jbuilder current working dir?jBuiler 4白皮书(来自inprise网站)Cryptoquivalence ClassesJava basic concept(4)Re: 怎样递归操作目录,子目录以及他们下面的文件?Re: 老板让偶买三本java的书2 Java Developer SCJD books downloadRe: Interesting thing about JDBC-ODBC! Help please.[转载] Java版诚招版副ldap exampleAnswer to "Is this a Bug or not? "JMIT v0.0.0.00002Re: 有感于《一个最近完成的JAVA项目的反思》Re: for help