malaikuangren

What is the purpose or drive to build thing like (xxx),How can it achieve the original goal of design?

2012年7月16日

Variable OR State Visiblity:Stale Data, Locking and Visiblity and Volatile(So many Unnoticed aspect in MultiThread)

摘要: Actually There are really something we may be miscoception . and so easilygo wrong . and the phenomenonare so counterintuitiveVisibility is subtle because the things that can go wrong are so counterintuitive. In a single-threaded environment, if you write a value to a variable and later read that va 阅读全文

posted @ 2012-07-16 22:08 malaikuangren 阅读(312) 评论(0) 推荐(0) 编辑
Servlet Only One Instance In Container?

摘要: the answer is depend on.You can let the servlet implementSingleThreadModelto get the container to create a pool of multiple instances of the same servlet class. The maximum pool size depends on the container used, on Tomcat for example, this is 20. But, a bigbut, this interface is deprecated since S 阅读全文

posted @ 2012-07-16 17:27 malaikuangren 阅读(320) 评论(0) 推荐(0) 编辑
Lock and Reentrant

摘要: Java provides a built-in locking mechanism for enforcing atomicity: the synchronizedblock.There is no inherent relationship between an object's intrinsic lock and its state; an object's fields need not be guarded by its intrinsic lock, though this is a perfectly valid locking convention that 阅读全文

posted @ 2012-07-16 15:34 malaikuangren 阅读(318) 评论(0) 推荐(0) 编辑