java.pdf


文档分类:论文 | 页数:约13页 举报非法文档有奖
1/13
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/13
文档列表 文档介绍
DZone, Inc. Alex Miller ABOUT J A V A CONCURRENCY Core Java Concurrency Get More Refcardz! Visit #61 Core Java Concurrency From its creation, Java has supported key concurrency concepts such as threads and locks. This guide helps Java developers working with multi-threaded programs to understand the core concurrency concepts and how to apply them. Topics covered in this guide include built- in Java language features like Thread, synchronized , and volatile , as well as new constructs added in JavaSE 5 such as Locks, Atomics, concurrent collections, thread coordination abstraction, and Executors. Using these building blocks, developers can build highly concurrent and thread-safe Java applications. CONCEPTS This section describes key Java Concurrency concepts that are used throughout this DZone Refcard. T able 1: Java Concurrency Concepts Concept Description Java Memory Model The Java Memory Model (JMM) was defined in Java SE 5 (JSR 133) and specifies the guarantees a JVM implementation must provide to a Java programmer when writing concurrent code. The JMM is defined in terms of actions like reading and writing fields, and synchronizing on a monitor. These actions form an ordering (called the “happens-before” ordering) that can be used to reason about when a thread sees the result of another thread’s actions, what constitutes a properly synchronized program, how to make fields immutable, and more. Monitor In Java, every object contains a “monitor” that can be used to provide mutual exlusion access to critical sections of code. The critical section is specified by marking a method or code block as synchronized . Only one thread at a time is allowed to execute any critical section of code for a particular monitor. When a thread reaches this section of code, it will wait indefinitely for the monitor to be released if another thread holds it. In addition to mutual exlusion, the monitor allows cooperation t

java 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数13
  • 收藏数0 收藏
  • 顶次数0
  • 上传人jianjian401
  • 文件大小0 KB
  • 时间2016-07-14