Access over 20 million homework & study documents

A) What are the benefits of using collections from the java util con

Content type
User Generated
Rating
Showing Page:
1/5
a) What are the benefits of using collections from the
java.util.concurrent package? (b) Describe the
java.util.concurrent.SynchronousQueue in Java? Compare
it to the java.util.concurrent.Exchanger class.
Please site sources
Solution
NOTE : Always prefer to use oracle documentation for
analysing classes ,interfaces,methods and constructors
especially while doing programming in java
Oracle documentation contains complete information
related to
packages,methods,classes,interfaces,constructors
java.util.concurrent package:
java.util.concurrent package in introduced in java 5 . This
package contains a set of classes and interfaces that
makes it easier to develop multithreaded applications in
Java.
Some of the interfaces are
BlockingDeque<E>
BlockingQueue<E>
Callable<V>

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/5
CompletionService<V>
ConcurrentMap<K,V>
Some of the classes are
AbstractExecutorService
ArrayBlockingQueue<E>
CopyOnWriteArraySet<E>
Exchanger<V> A synchronization point at which threads
can pair and swap elements within pairs
SynchronousQueue<E> A blocking queue in which each
insert operation must wait for a corresponding remove
operation by another thread, and vice versa.
Both java.util.concurrent.Exchanger class and
java.util.concurrent.SynchronousQueue are the classes in
java
java.util.concurrent.SynchronousQueue
java.util.concurrent.Exchanger class
It contains only two constructors SynchronousQueue()
SynchronousQueue(boolean fair)
It contains only one constructor
Exchanger()
Creates a new Exchanger.
It contains many methods some of the methods are
contains(Object o) Always returns it it contains true or
false if it doesnot contains objects.
containsAll(Collection<?> c)

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/5

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 5 pages?
Access Now
Unformatted Attachment Preview
a) What are the benefits of using collections from the java.util.concurrent package? (b) Describe the java.util.concurrent.SynchronousQueue in Java? Compare it to the java.util.concurrent.Exchanger class. Please site sources Solution NOTE : Always prefer to use oracle documentation for analysing classes ,interfaces,methods and constructors especially while doing programming in java Oracle documentation contains complete information related to packages,methods,classes,interfaces,constructors java.util.concurrent package: java.util.concurrent package in introduced in java 5 . This package contains a set of classes and interfaces that makes it easier to develop multithreaded applications in Java. Some of the interfaces are BlockingDeque BlockingQueue Callable CompletionService ConcurrentMap Some of the classes are AbstractExecutorService ArrayBlockingQueue CopyOnWriteArraySet Exchanger A synchronization point at which threads can pair and swap elements within pairs SynchronousQueue A blocking queue in which each insert operation must wait for a corresponding remove operation by another thread, and vice versa. Both java.util.concurrent.Exchanger class and java.util.concurrent.SynchronousQueue are the classes in java java.util.concurrent.SynchronousQueue java.util.concurrent.Exchanger class It contains only two constructors SynchronousQueue() SynchronousQueue(boolean fair) It contains only one constructor Exchanger() Creates a new Exchanger. It con ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Just what I needed…Fantastic!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4