failing to do so could result in data corruption and other undesirable consequences
You should avoid the temptation to think that there are "special" situations in which this rule does not apply.
data corruption 数据腐烂
If multiple threads access the same mutable state variable without appropriate synchronization, your program is broken. There are three ways to fix it:
Don't share the state variable across threads;
Make the state variable immutable; or
Use synchronization whenever accessing the state variable.
it may be necessary in these cases to compromise the rules of good design for the sake of performance or for the sake of
backward compatibility with legacy code.
for the sake of 为了
compromise n. 妥协, 折中方法 vi. 折中解决 vt. 连累, 危害, 损害
Sometimes abstraction and encapsulation are at odds with performance
at odds with 与…不和, 与…争吵
Even then, pursue optimization only if your performance measurements and requirements tell you that you must, and if those same measurements tell you that your optimizations actually made a difference under realistic conditions.
make a difference 紧要
even then 尽管那样
it is susceptible to lost updates
be susceptible to v. 对…敏感,可被…
returning the same value from multiple invocations could cause serious data integrity problems.
data integrity 数据完整性
An atomic operation is one that is atomic with respect to all operations
with respect to 关于, (至于)谈到
To ensure thread safety, check-then-act operations (like lazy initialization) and read-modify-write operations (like increment) must always be atomic.
they lay the foundation for building thread-safe classes and safely structuring concurrent applications using the java.util.concurrent library classes.
lay the foundation for 给…打下基础,为…奠定基础
NoVisibility demonstrated one of the ways that insufficiently synchronized programs can cause surprising results: stale data.
stale data 过期数据
Reading data without synchronization is analogous to using the READ_UNCOMMITTED isolation level in a database, where you are willing to trade accuracy for performance. However, in the case of unsynchronized reads, you are trading away a greater degree of accuracy, since the visible value for a shared variable can be arbitrarily stale.
be analogous to 类似于…,与…相似
trade for 用…换…
trade away 卖掉
This safety guarantee is called out-of-thin-air safety.
out of thin air 无中生有, 突然出现
Locking is not just about mutual exclusion; it is also about memory visibility. To ensure that all threads see the most up-to-date values of shared mutable variables, the reading and writing threads must synchronize on a common lock.
mutual exclusion (噬菌体)互斥现象
The most blatant form of publication is to store a reference in a public static field
blatant 1 吵嚷的;喧哗的 2 极明显的,公然的 3 无耻的,露骨的 4 刺眼的;炫耀的 dv. 无耻地,露骨地
UnsafeStates in Listing 3.6 publishes the supposedly private array of state abbreviations.
abbreviation 缩写; 缩写词
the states array has escaped its intended scope, because what was supposed to be private state has been effectively made public.
be supposed to v. 应该,被期望
Thread Confinement
confinement n. 1 限制,被监禁 2 分娩
Ad-hoc Thread Confinement
ad hoc adv.&adj. 1 为了某一特别场合或用途的(地),特别的(地),专门的(地) 2 机动的;临时的;特设的
Because of its fragility, ad-hoc thread confinement should be used sparingly
sparingly adv. 1 节俭地;爱惜地 2 保守地;谨慎地 3 缺少地 4 仁慈地
immutable objects cannot be subverted in this manner by malicious or buggy code,
subvert vt. 1 颠覆, 破坏(政治制度、宗教信仰等) 2 使(某人)道德败坏或不忠
More often than not, a cross join produces a result set containing misleading rows. Therefore, unless you are sure that you want a Cartesian product, don't use a cross join.
more often than not 往往, 多半
In this regard, it acts like a temporary table with statement scope
in this regard 在这点上
NULL can be used in place of a value of any data type
in place of 代替
Other than the union compatibility conditions discussed at the beginning of the chapter
other than 除了 绝不是
Over the past 15 years, hard disk capacities have evolved from around 10 MB to over 100 GB
evolve from 从…逐渐形〔发展〕成
As you’ve seen in the previous chapters, the beauty of this technique is that all
the service details are completely transparent to bean clients and even to bean
developers.
The System Task Scheduler, generally lesser known, is the Microsoft Windows counterpart of cron
counterpart 与对方地位相当的人, 与另一方作用相当的物
1)“Out of box”用于描述某种不确定的事件。常常作为副词来形容某种观点的不确定性。据说这个词同20世纪早期的英国数学家亨利?恩斯特?杜德耐解答一个著名数学谜语的思路相关。题目要求用四条直线连接平面上三乘三分布的九个点,要求一笔连成,也就是在画线的时候笔不能离开纸面。解决这个数学问题的关键在于要克服传统的在三乘三边界内画点的思想,如果将线连接到边界之外,那么问题可以迎刃而解,这样就产生了“Out of box”这个词。相应的,将思维受限这种情况称为“boxed-in”。在IT领域,节奏变化很快,因此每个人都在寻找“Out of box”的思维方式,尝试创新。
用“In the box”表示某种确定的事情。比如,最近有一篇文章讨论了MP3以及盗版音乐的关系,其中引用了一位业内人士的话表示:“主流唱片公司很少关心互联网上的发展,他们的思维就是‘Inside the box’”。
2)"Out of the box"(开箱即用)也用作"off the shelf"(现货供应)的同义词,其含义是指能够满足一定需求的、已经作好了的软件、硬件或两者的结合形式。如不采用,就需要投入专门的人力物力来开发。
例句:
The Common Annotations for the Java Platform' were introduced with Java EE version 5 and are also included out-of-the-box beginning with Java SE version 6.
分享到:
相关推荐
### 毕业论文读书笔记格式详解 #### 一、引言 在撰写毕业论文的过程中,阅读相关的文献资料是必不可少的环节。为了更好地理解和吸收这些资料中的精华,并将其有效地融入到自己的毕业论文中,撰写读书笔记显得尤为...
【标题】"java读书笔记笔记笔记笔记笔记笔记" 暗示了这是一份关于Java编程语言的学习笔记,可能包含了作者在阅读Java相关书籍时所做的重要记录和理解。笔记通常涵盖了语言的基础概念、核心特性、类与对象、内存管理...
从给定的文件信息来看,虽然标题和描述指向了“读书笔记”,但内容部分似乎包含了一些乱码,无法直接解析出具体的知识点。不过,基于标题和描述的提示,我们可以探讨一下如何撰写高质量的读书笔记,以及在IT行业背景...
计算机技术的读书笔记10篇计算机技术的读书笔记10篇计算机技术的读书笔记10篇计算机技术的读书笔记10篇计算机技术的读书笔记10篇
"计算机书籍读书笔记参考.docx" 本文档主要围绕 ASP.NET 和数据仓库两个主题展开,详细介绍了 ASP.NET 的工作方式、事件驱动模型、CLR(Common Language Runtime)运行阶段通用语言,以及数据仓库的概念、特点、...
读书笔记
《Android应用开发揭秘》读书笔记不仅是一份个人学习历程的记录,更是一部深入浅出的Android开发指南。本书籍及笔记覆盖了从基础知识到高级应用的广泛内容,为初学者和有经验的开发者提供了宝贵的资源。 ### ...
《艾略特波浪理论-市场行为的关键》读书笔记 《艾略特波浪理论-市场行为的关键》读书笔记是一份关于艾略特波浪理论的详细笔记,该理论是由拉尔夫·纳尔逊·艾略特提出的,旨在解释股票市场指数的可识别模式趋势和...
学生读书笔记共享-学生读书笔记共享系统-学生读书笔记共享系统源码-学生读书笔记共享管理系统-学生读书笔记共享管理系统java代码-学生读书笔记共享系统设计与实现-基于springboot的学生读书笔记共享系统-基于Web的...
1. 书籍介绍:《统计学与R读书笔记(第六版)》是一本结合统计学与R语言的图书,适合于有统计学或R语言学习需求的人群。这本书可能涉及了R的基础操作、统计方法应用以及R语言的高级特性。 2. R语言基础:文档中提到了...
【读书笔记概述】 读书笔记是阅读过程中的重要辅助工具,它可以帮助我们记录和理解书中的精华,提升记忆力,促进思考,积累素材,并提高写作和表达能力。读书笔记主要有三种类型:摘要式、批注式和体会式。 1. **...
学生读书笔记共享-学生读书笔记共享系统-学生读书笔记共享系统源码-学生读书笔记共享管理系统-学生读书笔记共享管理系统java代码-学生读书笔记共享系统设计与实现-基于springboot的学生读书笔记共享系统-基于Web的...
国家间政治读书笔记.pdf
标题中的“素雅简约风读书笔记ppt模板”指的是一个设计风格简洁、淡雅的PowerPoint模板,特别适合用于整理和展示个人的读书笔记。这样的模板通常包含一系列预设的页面布局,旨在帮助用户以清晰、有条理的方式呈现...
第一节 做读书笔记的方法 做读书笔记的方法很多。从内容来说,无非两类,一类以记书的内容为主,一类以记自己的感受为主,前者多是为了吸收,后者多是为了思考。从形式上来说,可以分为三种,一种是记在书上,一种...