Java ScheduledThreadPoolExecutor – Scheduling With ExecutorService

ScheduledThreadPoolExecutor in Java adds functionality to schedule commands to run after a given delay, or to execute periodically. Since ScheduledThreadPoolExecutor is an ExecutorService so it uses thread from a thread pool to execute tasks. Java ScheduledThreadPoolExecutor ScheduledThreadPoolExecutor class is part of Java Executor framework with in the Java concurrent API.…

Continue reading

Java Executor Tutorial – Executor, ExecutorService, ScheduledExecutorService

In this Java executor tutorial we’ll learn how to use Executor, ExecutorService, ScheduledExecutorService and their thread pool implementations to effectively manage threads in a large scale application. Java Executor API While using Java multi-threading for creating thread, there is a close connection between the task being done by a new…

Continue reading

ConcurrentLinkedDeque in Java

ConcurrentLinkedDeque in Java implements Deque interface and is part of java.util.concurrent package. ConcurrentLinkedDeque in Java is an unbounded concurrent deque which is thread-safe. It stores its elements as linked nodes where each node stores a reference to both previous and next nodes. How ConcurrentLinkedDeque differs from the blocking Deque implementations…

Continue reading

ConcurrentLinkedQueue in Java

ConcurrentLinkedQueue in Java implements Queue interface and is part of java.util.concurrent package. ConcurrentLinkedQueue in Java is an unbounded queue which is thread-safe. It stores its elements as linked nodes where each node stores a reference to the next node. How ConcurrentLinkedQueue differs from the BlockingQueue implementations like ArrayBlockingQueue, PriorityBlockingQueue is…

Continue reading

LinkedTransferQueue in Java

LinkedTransferQueue in Java is an implementation of the TransferQueue interface and is part of java.util.concurrent package. It was added in Java 7. TransferQueue interface in Java TransferQueue interface which extends BlockingQueue interface adds the capability where producers may wait for consumers to receive elements. In BlockingQueue implementations like ArrayBlockingQueue, PriorityBlockingQueue…

Continue reading

LinkedBlockingDeque in Java

LinkedBlockingDeque in Java is an implementation of BlockingDeque interface and is part of java.util.concurrent package. LinkedBlockingDeque, just like LinkedBlockingQueue, is an optionally-bounded blocking queue which means the capacity for the queue can be specified thus making it bounded or it can be left unspecified in which case capacity of the…

Continue reading