![]() ![]() A synchronous queue does not have internal capacity.Each insert operation in SynchronousQueue must wait for a corresponding remove operation by another thread, and also vice versa.Important points to remember about SynchronousQueue in Java : SynchronousQueue implements the BlockingQueue interface hence it is defined as a blocking queue . SynchronousQueue is synchronized i.e. Consider a scenario, where thread-1 is storing set of value in an ArrayList – SynchronousQueue(Synchronized Collection in Java).We know, Collection is a group of objects.Problems associated with non-synchronized collections Thread-safety is considered to be a very important feature for multi-threaded applications.įirst of all, let us understand why synchronized collection classes are required in Java. There are various collection utilities available in Java to make our development easier but very few collection classes are synchronized in nature i.e thread-safe. SynchronousQueue(Synchronized Collection in Java).HashTable (Synchronized Collection in Java).Vector (Synchronized Collection in Java).Here is the list of Synchronized collections classes in Java. ![]() Problems associated with non-synchronized collections.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |