Concurrent Programming in Java Java并发编程 Institute of Computer Software 2022-2-27 Nanjing University
Java并发编程 Concurrent Programming in Java 2022-2-27 Institute of Computer Software Nanjing University 1
&雪扇 摘要 0o2 UNIVER 2 Java1.5并发工具包介绍 口实例 Institute of Computer Software 2022-2-27 Nanjing University
摘要 Java 1.5 并发工具包介绍 实例 2022-2-27 Institute of Computer Software Nanjing University 2
&扇 Java并发编程机制 1902 3 口Pre Java1.5 Thread,Runnable ▣synchronized wait,notify,notifyAll Institute of Computer Software 2022-2-27 Nanjing University
Java 并发编程机制 Pre Java 1.5 Thread, Runnable synchronized wait, notify, notifyAll 2022-2-27 Institute of Computer Software Nanjing University 3
Java 1.5 Concurrency Utilities Java 1.5 has comprehensive support for general-purpose concurrent programming The support is partitioned into three packages: java.util.concurrent this provides various classes to support common concurrent programming paradigms,e.g.,support for various queuing policies such as bounded buffers,sets and maps,thread pools etc java.util.concurrent.atomic this provides support for lock-free thread-safe programming on simple variables such as atomic integers,atomic booleans,etc. java.util.concurrent.locks this provides a framework for various locking algorithms that augment the Java language mechanisms, e.g.,read -write locks and condition variables. Institute of Computer Software 2022-2-27 Nanjing University
Java 1.5 Concurrency Utilities Java 1.5 has comprehensive support for general-purpose concurrent programming The support is partitioned into three packages: java.util.concurrent - this provides various classes to support common concurrent programming paradigms, e.g., support for various queuing policies such as bounded buffers, sets and maps, thread pools etc java.util.concurrent.atomic - this provides support for lock-free thread-safe programming on simple variables such as atomic integers, atomic booleans, etc. java.util.concurrent.locks - this provides a framework for various locking algorithms that augment the Java language mechanisms, e.g., read -write locks and condition variables. 2022-2-27 Institute of Computer Software Nanjing University 4
&扇 Java并发编程机制 UNIVE 5 Java 1.5+Concurrent Utilities ▣Why? 口What'snew2 ▣How to use? Let's“'listen to”some famous speech! Institute of Computer Software 2022-2-27 Nanjing University
Java 并发编程机制 Java 1.5+ Concurrent Utilities Why? What' s new? How to use? 2022-2-27 Institute of Computer Software Nanjing University 5 Let’s “listen to” some famous speech!
JavaOne Sun's 2004 Worldwide Java Developer Conference- Concurrency Utilities in JDK 1.5 (Tiger) java.sun.com/javaone/sf Multithreading made simple(r) David Holmes Director,DLTeCH Pty Ltd Java Brian Goetz Principal Consultant,Quiotix Corp Sun
2022-2-27 Institute of Computer Software Nanjing University 6
What This Talk Is About How to use the new concurrency utilities (the java.util.concurrent package) to replace error-prone or inefficient code and to better structure applications
2022-2-27 Institute of Computer Software Nanjing University 7
Speakers -David Holmes is a regular speaker on concurrent programming in Java,co- author of The Java Programming Language 3rd Ed.and a member of the JSR 166 Expert Group -Brian Goetz is author of over 50 articles on Java development and a member of the JSR 166 Expert Group
2022-2-27 Institute of Computer Software Nanjing University 8
Rationale for JSR 166 Developing concurrent classes is too hard The built-in concurrency primitives-wait () notify ()and synchronized-are,well, primitive ·Hard to use correctly Easy to use incorrectly Specified at too low a level for most applications . Can lead to poor performance if used in correctly Too much wheel-reinventing!
2022-2-27 Institute of Computer Software Nanjing University 9
Goals for JSR 166 Simplify development of concurrent applications Do for concurrency what the Collections framework did for data structures! Provide a set of basic concurrency building blocks that can be widely reused Enhance scalability,performance,readability, maintainability,and thread-safety of concurrent Java applications
2022-2-27 Institute of Computer Software Nanjing University 10