zoukankan      html  css  js  c++  java
  • Java并发编程实践前言

    Preface
    前言

    At this writing, multicore processors are just now becoming inexpensive enough for midrange desktop systems. Not coincidentally, many development teams are noticing more and more threading-related bug reports in their projects. In a recent post on the NetBeans developer site, one of the core maintainers observed that a single class had been patched over 14 times to fix threading-related problems. Dion Almaer, former editor of TheServerSide, recently blogged (after a painful debugging session that ultimately revealed a threading bug) that most Java programs are so rife with concurrency bugs that they work only “by accident”.
    写本书的时候,多核处理器价格一不再高不可攀,中端的桌面系统就可以配备得起。与此同时,许多开发团队在项目中发现越来越多与线程相关的缺陷。最近在NetBeans开发者网站上的一个帖子中,一个核心的维护人员写到,为了修复一个线程有关的问题,仅一个类就修复了14次以上。TheServerSide前编辑Dion Almaer最近在博客中写到大多数Java程序都充满并发缺陷,这些程序能工作只是“偶然的”。此前他进行了一番痛苦的调试,而调试最终发现了问题是由一个线程缺陷造成的。

    Indeed, developing, testing and debugging multithreaded programs can be extremely difficult because concurrency bugs do not manifest themselves predictably. And when they do surface, it is often at the worst possible time—in production, under heavy load.
    毫无疑问,开发,测试和调试多线程程序师十分困难的,因为同步缺陷的出现并不是确定的。而它们的出现往往发生在最坏的情况下,那就是在重负荷的生产环境中。

    One of the challenges of developing concurrent programs in Java is the mismatch between the concurrency features offered by the platform and how developers need to think about concurrency in their programs. The language provides low-level mechanisms such as synchronization and condition waits, but these mechanisms must be used consistently to implement application-level protocols
    or policies. Without such policies, it is all too easy to create programs that compile and appear to work but are nevertheless broken. Many otherwise excellent books on concurrency fall short of their goal by focusing excessively on low-level mechanisms and APIs rather than design-level policies and patterns
    开发Java同步程序的一个困难在于平台提供的并发特性和开发人员开发同步程序时的思维不匹配。Java提供的是同步和条件等待等底层机制,而这些机制在使用是需要使用一致的应用层面的协议和策略。没有这样的策略,程序很可能看起来是对的但其实是有问题的。很多讲同步编程的书没有能很好的阐述这一主题,它们过多的讲述底层机制和API而不是设计层面的策略和模式。

    Java is a huge step forward for the development of concurrent applications in Java, providing new higher-level components and additional low-level mechanisms that make it easier for novices and experts alike to build concurrent applications. The authors are the primary members of the JCP Expert Group that created these facilities; in addition to describing their behavior and features,
    we present the underlying design patterns and anticipated usage scenarios that motivated their inclusion in the platform libraries.
    Java 5.0
    在开发同步程序方便取得了很大进步。它提供了高层的组件,同时也加入了底层机制,这样不过是初学者还是撞见都能开发同步程序。本书的作者都是编写这些工具的JCP专家组成员,除了描述这些组件的行为和特性,我们还讲述组件背后的设计模式和促使我们把它们包含到平台类库中能想到的应用场景。

    Our goal is to give readers a set of design rules and mental models that make it easier—and more fun—to build correct, performant concurrent classes and applications in Java.
    我们的目标是给读者一套设计法则和思维模型,以便开发人员能使用Java轻松快乐的开发正确的,性能好的同步类和程序。

    We hope you enjoy Java Concurrency in Practice.
    希望您能喜欢本书。

    Brian Goetz
    Williston, VT
    March 2006
    Brian Goetz
    Williston于福福尼亚理工大学
    2006年3月

  • 相关阅读:
    vim快速查找
    一次特别二不兮兮的WebStorm经历
    让docker容器使用主机系统时间(挂入/etc/localtime)
    systemd:在service文件中给Exec传入多个参数
    mongodb数据迁移
    明日边缘;逃出克隆岛
    [C++] 类的所有对象实例共享静态类成员变量
    HTTP长连接
    fqPkzJetPK
    何时使用move
  • 原文地址:https://www.cnblogs.com/littlesuccess/p/2257612.html
Copyright © 2011-2022 走看看