SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
Concurrency Utilities
                               Overview
Introduction

The Java 2 platform includes a new package of concurrency utilities. These are classes which are
designed to be used as building blocks in building concurrent classes or applications. Just as the
Collections Framework greatly simplified the organization and manipulation of in-memory data
by providing implementations of commonly used data structures, the Concurrency Utilities aims
to simplify the development of concurrent classes by providing implementations of building
blocks commonly used in concurrent designs. The Concurrency Utilities include a high-
performance, flexible thread pool; a framework for asynchronous execution of tasks; a host of
collection classes optimized for concurrent access; synchronization utilities such as counting
semaphores; atomic variables; locks; and condition variables.

Using the Concurrency Utilities, instead of developing components such as thread pools
yourself, offers a number of advantages:

       Reduced programming effort. It is far easier to use a standard class than to develop it
       yourself.
       Increased performance. The implementations in the Concurrency Utilities were
       developed and peer-reviewed by concurrency and performance experts; these
       implementations are likely to be faster and more scalable than a typical implementation,
       even by a skilled developer.
       Increased reliability. Developing concurrent classes is difficult -- the low-level
       concurrency primitives provided by the Java language ( synchronized, volatile,
       wait(), notify(), and notifyAll()) are difficult to use correctly, and errors using
       these facilities can be difficult to detect and debug. By using standardized, extensively
       tested concurrency building blocks, many potential sources of threading hazards such as
       deadlock, starvation, race conditions, or excessive context switching are eliminated. The
       concurrency utilities have been carefully audited for deadlock, starvation, and race
       conditions.
       Improved maintainability. Programs which use standard library classes are easier to
       understand and maintain than those which rely on complicated, homegrown classes.
       Increased productivity. Developers are likely to already understand the standard library
       classes, so there is no need to learn the API and behavior of ad-hoc concurrent
       components. Additionally, concurrent applications are far simpler to debug when they are
       built on reliable, well-tested components.

In short, using the Concurrency Utilities to implement a concurrent application can help you
make your program clearer, shorter, faster, more reliable, more scalable, easier to write, easier to
read, and easier to maintain.
The Concurrency Utilities includes:

           Task Scheduling Framework - The Executor framework is a framework for
           standardizing invocation, scheduling, execution, and control of asynchronous tasks
           according to a set of execution policies. Implementations are provided that allow tasks to
           be executed within the submitting thread, in a single background thread (as with events in
           Swing), in a newly created thread, or in a thread pool, and developers can create
           customized implementations of Executor supporting arbitrary execution policies. The
           built-in implementations offer configurable policies such as queue length limits and
           saturation policy which can improve the stability of applications by preventing runaway
           resource consumption.
           Concurrent Collections - Several new Collections classes have been added, including
           the new Queue, BlockingQueue and BlockingDeque interfaces, and high-performance,
           concurrent implementations of Map, List, and Queue. See the Collections Framework
           Guide for more details.
           Atomic Variables - Classes for atomically manipulating single variables (primitive types
           or references), providing high-performance atomic arithmetic and compare-and-set
           methods. The atomic variable implementations in java.util.concurrent.atomic offer
           higher performance than would be available by using synchronization (on most
           platforms), making them useful for implementing high-performance concurrent
           algorithms as well as conveniently implementing counters and sequence number
           generators.
           Synchronizers - General purpose synchronization classes, including semaphores,
           mutexes, barriers, latches, and exchangers, which facilitate coordination between threads.
           Locks - While locking is built into the Java language via the synchronized keyword,
           there are a number of inconvenient limitations to built-in monitor locks. The
           java.util.concurrent.locks package provides a high-performance lock
           implementation with the same memory semantics as synchronization, but which also
           supports specifying a timeout when attempting to acquire a lock, multiple condition
           variables per lock, non-nested ("hand-over-hand") holding of multiple locks, and support
           for interrupting threads which are waiting to acquire a lock.
           Nanosecond-granularity timing - The System.nanoTime method enables access to a
           nanosecond-granularity time source for making relative time measurements, and methods
           which accept timeouts (such as the BlockingQueue.offer, BlockingQueue.poll,
           Lock.tryLock, Condition.await, and Thread.sleep) can take timeout values in
           nanoseconds. The actual precision of System.nanoTime is platform-dependent.


Copyright © 2004 Sun Microsystems, Inc. All Rights Reserved.


                                                                                     Java Software

Contenu connexe

Similaire à Java Concurrency Utilities Overview

Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in developmentMartin Toshev
 
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicOracle
 
Build cloud native solution using open source
Build cloud native solution using open source Build cloud native solution using open source
Build cloud native solution using open source Nitesh Jadhav
 
What is a Test Automation framework.pdf
What is a Test Automation framework.pdfWhat is a Test Automation framework.pdf
What is a Test Automation framework.pdfAnanthReddy38
 
The Rise of App-chains: Driving Scalability, Security, and Performance with A...
The Rise of App-chains: Driving Scalability, Security, and Performance with A...The Rise of App-chains: Driving Scalability, Security, and Performance with A...
The Rise of App-chains: Driving Scalability, Security, and Performance with A...Zeeve
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On ConcurrencyRodney Barlow
 
ZStack architecture overview
ZStack architecture overviewZStack architecture overview
ZStack architecture overviewFrank Zhang
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On ConcurrencyWill Gage
 
Intro to kubernetes
Intro to kubernetesIntro to kubernetes
Intro to kubernetesElad Hirsch
 
Introduction to Java Enterprise Edition
Introduction to Java Enterprise EditionIntroduction to Java Enterprise Edition
Introduction to Java Enterprise EditionAbdalla Mahmoud
 
From Model to Implementation II
From Model to Implementation IIFrom Model to Implementation II
From Model to Implementation IIReem Alattas
 
Cloud 2010
Cloud 2010Cloud 2010
Cloud 2010steccami
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview Krishna-Kumar
 
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdfDr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdfDr.Florence Dayana
 
comparative study of Cloud computing tools
comparative study of Cloud computing tools comparative study of Cloud computing tools
comparative study of Cloud computing tools Aditya Trivedi
 

Similaire à Java Concurrency Utilities Overview (20)

As34269277
As34269277As34269277
As34269277
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in development
 
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
 
Build cloud native solution using open source
Build cloud native solution using open source Build cloud native solution using open source
Build cloud native solution using open source
 
Struts Interceptors
Struts InterceptorsStruts Interceptors
Struts Interceptors
 
What is a Test Automation framework.pdf
What is a Test Automation framework.pdfWhat is a Test Automation framework.pdf
What is a Test Automation framework.pdf
 
Netkit
NetkitNetkit
Netkit
 
The Java Memory Model
The Java Memory ModelThe Java Memory Model
The Java Memory Model
 
The Rise of App-chains: Driving Scalability, Security, and Performance with A...
The Rise of App-chains: Driving Scalability, Security, and Performance with A...The Rise of App-chains: Driving Scalability, Security, and Performance with A...
The Rise of App-chains: Driving Scalability, Security, and Performance with A...
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On Concurrency
 
ZStack architecture overview
ZStack architecture overviewZStack architecture overview
ZStack architecture overview
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On Concurrency
 
Intro to kubernetes
Intro to kubernetesIntro to kubernetes
Intro to kubernetes
 
Introduction to Java Enterprise Edition
Introduction to Java Enterprise EditionIntroduction to Java Enterprise Edition
Introduction to Java Enterprise Edition
 
December 2012 drylab
December 2012 drylabDecember 2012 drylab
December 2012 drylab
 
From Model to Implementation II
From Model to Implementation IIFrom Model to Implementation II
From Model to Implementation II
 
Cloud 2010
Cloud 2010Cloud 2010
Cloud 2010
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview
 
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdfDr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
 
comparative study of Cloud computing tools
comparative study of Cloud computing tools comparative study of Cloud computing tools
comparative study of Cloud computing tools
 

Plus de white paper

Secure Computing With Java
Secure Computing With JavaSecure Computing With Java
Secure Computing With Javawhite paper
 
Java Security Overview
Java Security OverviewJava Security Overview
Java Security Overviewwhite paper
 
Platform Migration Guide
Platform Migration GuidePlatform Migration Guide
Platform Migration Guidewhite paper
 
Java Standard Edition 5 Performance
Java Standard Edition 5 PerformanceJava Standard Edition 5 Performance
Java Standard Edition 5 Performancewhite paper
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performancewhite paper
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performancewhite paper
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performancewhite paper
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performancewhite paper
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performancewhite paper
 
Memory Management in the Java HotSpot Virtual Machine
Memory Management in the Java HotSpot Virtual MachineMemory Management in the Java HotSpot Virtual Machine
Memory Management in the Java HotSpot Virtual Machinewhite paper
 
J2 Se 5.0 Name And Version Change
J2 Se 5.0 Name And Version ChangeJ2 Se 5.0 Name And Version Change
J2 Se 5.0 Name And Version Changewhite paper
 
Java Tuning White Paper
Java Tuning White PaperJava Tuning White Paper
Java Tuning White Paperwhite paper
 
Java Apis For Imaging Enterprise-Scale, Distributed 2d Applications
Java Apis For Imaging Enterprise-Scale, Distributed 2d ApplicationsJava Apis For Imaging Enterprise-Scale, Distributed 2d Applications
Java Apis For Imaging Enterprise-Scale, Distributed 2d Applicationswhite paper
 
Introduction to the Java(TM) Advanced Imaging API
Introduction to the Java(TM) Advanced Imaging APIIntroduction to the Java(TM) Advanced Imaging API
Introduction to the Java(TM) Advanced Imaging APIwhite paper
 
* Evaluation of Java Advanced Imaging (1.0.2) as a Basis for Image Proce...
     * Evaluation of Java Advanced Imaging (1.0.2) as a Basis for Image Proce...     * Evaluation of Java Advanced Imaging (1.0.2) as a Basis for Image Proce...
* Evaluation of Java Advanced Imaging (1.0.2) as a Basis for Image Proce...white paper
 
Java 2D API: Enhanced Graphics and Imaging for the Java Platform
Java 2D API: Enhanced Graphics and Imaging for the Java PlatformJava 2D API: Enhanced Graphics and Imaging for the Java Platform
Java 2D API: Enhanced Graphics and Imaging for the Java Platformwhite paper
 
Defining a Summative Usability Test for Voting Systems
Defining a Summative Usability Test for Voting SystemsDefining a Summative Usability Test for Voting Systems
Defining a Summative Usability Test for Voting Systemswhite paper
 
Usability Performance Benchmarks
Usability Performance BenchmarksUsability Performance Benchmarks
Usability Performance Benchmarkswhite paper
 
The Effect of Culture on Usability
The Effect of Culture on UsabilityThe Effect of Culture on Usability
The Effect of Culture on Usabilitywhite paper
 

Plus de white paper (20)

Secure Computing With Java
Secure Computing With JavaSecure Computing With Java
Secure Computing With Java
 
Java Security Overview
Java Security OverviewJava Security Overview
Java Security Overview
 
Platform Migration Guide
Platform Migration GuidePlatform Migration Guide
Platform Migration Guide
 
Java Standard Edition 5 Performance
Java Standard Edition 5 PerformanceJava Standard Edition 5 Performance
Java Standard Edition 5 Performance
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performance
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performance
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performance
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performance
 
Java Standard Edition 6 Performance
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performance
 
Memory Management in the Java HotSpot Virtual Machine
Memory Management in the Java HotSpot Virtual MachineMemory Management in the Java HotSpot Virtual Machine
Memory Management in the Java HotSpot Virtual Machine
 
J2 Se 5.0 Name And Version Change
J2 Se 5.0 Name And Version ChangeJ2 Se 5.0 Name And Version Change
J2 Se 5.0 Name And Version Change
 
Java Web Start
Java Web StartJava Web Start
Java Web Start
 
Java Tuning White Paper
Java Tuning White PaperJava Tuning White Paper
Java Tuning White Paper
 
Java Apis For Imaging Enterprise-Scale, Distributed 2d Applications
Java Apis For Imaging Enterprise-Scale, Distributed 2d ApplicationsJava Apis For Imaging Enterprise-Scale, Distributed 2d Applications
Java Apis For Imaging Enterprise-Scale, Distributed 2d Applications
 
Introduction to the Java(TM) Advanced Imaging API
Introduction to the Java(TM) Advanced Imaging APIIntroduction to the Java(TM) Advanced Imaging API
Introduction to the Java(TM) Advanced Imaging API
 
* Evaluation of Java Advanced Imaging (1.0.2) as a Basis for Image Proce...
     * Evaluation of Java Advanced Imaging (1.0.2) as a Basis for Image Proce...     * Evaluation of Java Advanced Imaging (1.0.2) as a Basis for Image Proce...
* Evaluation of Java Advanced Imaging (1.0.2) as a Basis for Image Proce...
 
Java 2D API: Enhanced Graphics and Imaging for the Java Platform
Java 2D API: Enhanced Graphics and Imaging for the Java PlatformJava 2D API: Enhanced Graphics and Imaging for the Java Platform
Java 2D API: Enhanced Graphics and Imaging for the Java Platform
 
Defining a Summative Usability Test for Voting Systems
Defining a Summative Usability Test for Voting SystemsDefining a Summative Usability Test for Voting Systems
Defining a Summative Usability Test for Voting Systems
 
Usability Performance Benchmarks
Usability Performance BenchmarksUsability Performance Benchmarks
Usability Performance Benchmarks
 
The Effect of Culture on Usability
The Effect of Culture on UsabilityThe Effect of Culture on Usability
The Effect of Culture on Usability
 

Dernier

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Dernier (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Java Concurrency Utilities Overview

  • 1. Concurrency Utilities Overview Introduction The Java 2 platform includes a new package of concurrency utilities. These are classes which are designed to be used as building blocks in building concurrent classes or applications. Just as the Collections Framework greatly simplified the organization and manipulation of in-memory data by providing implementations of commonly used data structures, the Concurrency Utilities aims to simplify the development of concurrent classes by providing implementations of building blocks commonly used in concurrent designs. The Concurrency Utilities include a high- performance, flexible thread pool; a framework for asynchronous execution of tasks; a host of collection classes optimized for concurrent access; synchronization utilities such as counting semaphores; atomic variables; locks; and condition variables. Using the Concurrency Utilities, instead of developing components such as thread pools yourself, offers a number of advantages: Reduced programming effort. It is far easier to use a standard class than to develop it yourself. Increased performance. The implementations in the Concurrency Utilities were developed and peer-reviewed by concurrency and performance experts; these implementations are likely to be faster and more scalable than a typical implementation, even by a skilled developer. Increased reliability. Developing concurrent classes is difficult -- the low-level concurrency primitives provided by the Java language ( synchronized, volatile, wait(), notify(), and notifyAll()) are difficult to use correctly, and errors using these facilities can be difficult to detect and debug. By using standardized, extensively tested concurrency building blocks, many potential sources of threading hazards such as deadlock, starvation, race conditions, or excessive context switching are eliminated. The concurrency utilities have been carefully audited for deadlock, starvation, and race conditions. Improved maintainability. Programs which use standard library classes are easier to understand and maintain than those which rely on complicated, homegrown classes. Increased productivity. Developers are likely to already understand the standard library classes, so there is no need to learn the API and behavior of ad-hoc concurrent components. Additionally, concurrent applications are far simpler to debug when they are built on reliable, well-tested components. In short, using the Concurrency Utilities to implement a concurrent application can help you make your program clearer, shorter, faster, more reliable, more scalable, easier to write, easier to read, and easier to maintain.
  • 2. The Concurrency Utilities includes: Task Scheduling Framework - The Executor framework is a framework for standardizing invocation, scheduling, execution, and control of asynchronous tasks according to a set of execution policies. Implementations are provided that allow tasks to be executed within the submitting thread, in a single background thread (as with events in Swing), in a newly created thread, or in a thread pool, and developers can create customized implementations of Executor supporting arbitrary execution policies. The built-in implementations offer configurable policies such as queue length limits and saturation policy which can improve the stability of applications by preventing runaway resource consumption. Concurrent Collections - Several new Collections classes have been added, including the new Queue, BlockingQueue and BlockingDeque interfaces, and high-performance, concurrent implementations of Map, List, and Queue. See the Collections Framework Guide for more details. Atomic Variables - Classes for atomically manipulating single variables (primitive types or references), providing high-performance atomic arithmetic and compare-and-set methods. The atomic variable implementations in java.util.concurrent.atomic offer higher performance than would be available by using synchronization (on most platforms), making them useful for implementing high-performance concurrent algorithms as well as conveniently implementing counters and sequence number generators. Synchronizers - General purpose synchronization classes, including semaphores, mutexes, barriers, latches, and exchangers, which facilitate coordination between threads. Locks - While locking is built into the Java language via the synchronized keyword, there are a number of inconvenient limitations to built-in monitor locks. The java.util.concurrent.locks package provides a high-performance lock implementation with the same memory semantics as synchronization, but which also supports specifying a timeout when attempting to acquire a lock, multiple condition variables per lock, non-nested ("hand-over-hand") holding of multiple locks, and support for interrupting threads which are waiting to acquire a lock. Nanosecond-granularity timing - The System.nanoTime method enables access to a nanosecond-granularity time source for making relative time measurements, and methods which accept timeouts (such as the BlockingQueue.offer, BlockingQueue.poll, Lock.tryLock, Condition.await, and Thread.sleep) can take timeout values in nanoseconds. The actual precision of System.nanoTime is platform-dependent. Copyright © 2004 Sun Microsystems, Inc. All Rights Reserved. Java Software