<img alt="" src="https://secure.leadforensics.com/150446.png " style="display:none;">

Blogs

The Executor Framework – Part V

So far in the Executor Framework blog post series, I have covered the following topics:

Topics: Executor Executors.newCachedThreadPool Java Callable ExecutorService invokeAny Multithreading BlockingQueue Concurrency API ThreadPoolExecutor ExecutorService callable Executors Technology

Interrupting Threads In Java

In a Java application, a thread may keep waiting for a long time after executing wait() or Thread.join() or by put() or take() methods of a BlockingQueue. We also refer such a thread as a blocked thread since it remains blocked until some operation is performed. Sometimes a thread can also be blocked for a certain time by Thread.sleep(). When a thread is blocked for a long time you may need to take the thread out of the WAITING or TIMED_WAITING state. While writing a Java application, we need to take care that a thread does not remain blocked for too long. The corrective action that needs to be performed in such circumstances depends on the type of task the thread is executing. If the task is cancellable, it is simply aborted and if it is not cancellable then a logic needs to be implemented to enable its execution.

Topics: Java NIO ReentrantLock Runnable Java ExecutorService Callable Thread Multithreading BlockingQueue InterruptibleChannel Future Technology Thread Interrupt

Queues And Blocking Queues

The Java Collections Framework provides Queue interface and its implementation classes as shown in Figure 1 which enable usage of queue data structure in a variety of ways. The interfaces and classes highlighted in this figure are part of Concurrency API.

Topics: DelayQueue ConcurrentLinkedQueue LinkedBlockingDeque LinkedBlockingQueue BlockingDeque ConcurrentLinkedDeque Queue LinkedTransferQueue Java PriorityQueue TransferQueue Multithreading ArrayBlockingQueue BlockingQueue SynchronousQueue Collections Framework Concurrency API Deque PriorityBlockingQueue LinkedList Technology ArrayDeque

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.